2

我正在尝试使用cmakeand编译库的一部分make。当我运行Make包含失败时出现错误:

/home/user/Sean/PCL/pcl/apps/src/face_detection/openni_face_detection.cpp:9:57: fatal error: pcl/apps/face_detection/openni_frame_source.h: No such file or directory compilation terminated.

我知道使用gcc,您可以让编译器向您读取它在哪里寻找包含,但是有没有办法使用makeand来完成此操作cmake

4

2 回答 2

3

If the Makefile is automatically generated by CMake, you can launch make like this:

> make VERBOSE=1

to interleave the progression on targets with the actual commands make is executing. From these commands you should be able to extract the current include paths.

You may probably want to take also a look at the include_directories CMake command, in case some include paths are missing.

于 2013-07-17T07:14:26.830 回答
1

我正在使用 mingw32 在 SUSE Linux 上交叉编译 Win32 目标。传统的详细/调试选项都没有提供#include搜索路径。

这迫使我(懒惰的)手手动重现最终显示标题搜索路径的编译操作。

简要说明...

  • 运行 make 操作并记下编译器目录和它正在执行的命令行。是的,这很混乱,但并非不可能。如果无头,则将输出捕获到文件。
  • 切换到目录
  • --help使用该选项执行编译器。注意它的详细选项。
  • 运行指定详细选项的编译命令。

这就是我得到的...

#include "..." search starts here:
#include <...> search starts here:
 /home/me/rpmbuild/BUILD/the-app-0.0.0/core/src/win32/include
 /home/me/rpmbuild/BUILD/the-app-0.0.0/core/src/win32/compat/include
 /home/me/rpmbuild/BUILD/the-app-0.0.0/core/src
 /home/me/rpmbuild/BUILD/the-app-0.0.0/core/src/win32/generic
 /home/me/rpmbuild/BUILD/the-app-0.0.0/core/src/win32/filed
 /usr/lib64/gcc/x86_64-w64-mingw32/8.2.0/include/c++
 /usr/lib64/gcc/x86_64-w64-mingw32/8.2.0/include/c++/x86_64-w64-mingw32
 /usr/lib64/gcc/x86_64-w64-mingw32/8.2.0/include/c++/backward
 /usr/lib64/gcc/x86_64-w64-mingw32/8.2.0/include
 /usr/lib64/gcc/x86_64-w64-mingw32/8.2.0/include-fixed
 /usr/x86_64-w64-mingw32/sys-root/mingw/include
End of search list.

还不算太差...

顺便说一句,这是一个 cmake 3.5.2 配置。

于 2019-05-04T06:20:30.263 回答