如何在编译失败时找到缺失的依赖?
How to find the missing dependency in failed compilation?
有时在编译错误时会输出缺少的头文件的名称,并且可以使用 Linux 包管理器追踪它来自的包。
但是当错误是下面这种错误时,它没有给你丢失的头文件的名称,如何找到丢失的依赖项?
make[2]: *** [examples/undocumented/libshogun/base_map_parameters] Error 1
CMakeFiles/Makefile2:916: recipe for target 'examples/undocumented/libshogun/CMakeFiles/base_map_parameters.dir/all' failed
make[1]: *** [examples/undocumented/libshogun/CMakeFiles/base_map_parameters.dir/all] Error 2
../../../src/shogun/libshogun.so.17.1: undefined reference to `SZ_BufftoBuffDecompress'
../../../src/shogun/libshogun.so.17.1: undefined reference to `SZ_encoder_enabled'
../../../src/shogun/libshogun.so.17.1: undefined reference to `SZ_BufftoBuffCompress'
collect2: error: ld returned 1 exit status
examples/undocumented/libshogun/CMakeFiles/base_migration_dropping_and_new.dir/build.make:129: recipe for target 'examples/undocumented/libshogun/base_migration_dropping_and_new' failed
您提供的头文件示例是一个编译时错误。编译器知道这些文件并可以向您显示缺少的内容。您在上面出现的错误是 link 时间错误。
你提供的是一个普通的,是一个symbol没有定义。通常发生这种情况是因为库被排除在 linker 行之外。此错误的另一个常见来源是您link访问的库比程序预期的要旧。
通常,当出现此类错误时,我会发现自己在 Google 上搜索 this one 之类的文章。打包管理器在计算文件或库时不跟踪功能级别的详细信息。我一直认为使用 nm 命令检查库并将该元数据放入打包系统会是一个很好的增强。
(这不是通用答案,但是)在这种情况下,googling SZ_BufftoBuffDecompress gave, among others, the link to https://github.com/PacificBiosciences/blasr/issues/4, where it is suggested
It seems that the hdf5 library is not correctly installed. The hdf5 lib that you used requires szip library. So you may need to install szip lib first and then re-make your hdf5 package (linking it with the szip lib, -lsz).
所以似乎 缺少的依赖项是 szip。
至于一般搜索,@Thomas Padron-McCarthy 的评论明智地建议
perhaps add the program name
和
on Ubuntu I might also add apt-get
and install
, to directly find instructions on how to install the missing parts!
如果您只需要软件,而不需要自己编译,请查看github post。 Another poster
suggest[s] using Homebrew and Linuxbrew to install science software on Mac and Linux, repsectively[sic].
有时在编译错误时会输出缺少的头文件的名称,并且可以使用 Linux 包管理器追踪它来自的包。
但是当错误是下面这种错误时,它没有给你丢失的头文件的名称,如何找到丢失的依赖项?
make[2]: *** [examples/undocumented/libshogun/base_map_parameters] Error 1
CMakeFiles/Makefile2:916: recipe for target 'examples/undocumented/libshogun/CMakeFiles/base_map_parameters.dir/all' failed
make[1]: *** [examples/undocumented/libshogun/CMakeFiles/base_map_parameters.dir/all] Error 2
../../../src/shogun/libshogun.so.17.1: undefined reference to `SZ_BufftoBuffDecompress'
../../../src/shogun/libshogun.so.17.1: undefined reference to `SZ_encoder_enabled'
../../../src/shogun/libshogun.so.17.1: undefined reference to `SZ_BufftoBuffCompress'
collect2: error: ld returned 1 exit status
examples/undocumented/libshogun/CMakeFiles/base_migration_dropping_and_new.dir/build.make:129: recipe for target 'examples/undocumented/libshogun/base_migration_dropping_and_new' failed
您提供的头文件示例是一个编译时错误。编译器知道这些文件并可以向您显示缺少的内容。您在上面出现的错误是 link 时间错误。
你提供的是一个普通的,是一个symbol没有定义。通常发生这种情况是因为库被排除在 linker 行之外。此错误的另一个常见来源是您link访问的库比程序预期的要旧。
通常,当出现此类错误时,我会发现自己在 Google 上搜索 this one 之类的文章。打包管理器在计算文件或库时不跟踪功能级别的详细信息。我一直认为使用 nm 命令检查库并将该元数据放入打包系统会是一个很好的增强。
(这不是通用答案,但是)在这种情况下,googling SZ_BufftoBuffDecompress gave, among others, the link to https://github.com/PacificBiosciences/blasr/issues/4, where it is suggested
It seems that the hdf5 library is not correctly installed. The hdf5 lib that you used requires szip library. So you may need to install szip lib first and then re-make your hdf5 package (linking it with the szip lib, -lsz).
所以似乎 缺少的依赖项是 szip。
至于一般搜索,@Thomas Padron-McCarthy 的评论明智地建议
perhaps add the program name
和
on Ubuntu I might also add
apt-get
andinstall
, to directly find instructions on how to install the missing parts!
如果您只需要软件,而不需要自己编译,请查看github post。 Another poster
suggest[s] using Homebrew and Linuxbrew to install science software on Mac and Linux, repsectively[sic].