为什么指定了cmake的查找头文件路径无效,还是去找系统路径

Fu_Lin_
博客专家认证
2016-03-23 11:17:40
n file included from /usr/local/toolschain/4.5.1/bin/../lib/gcc/arm-none-linux-gnueabi/4.5.1/../../../../arm-none-linux-gnueabi/include/math.h:416:0,
from /home/fl/test/OpenCV-2.3.1/modules/highgui/../core/include/opencv2/core/types_c.h:83,
from /home/fl/test/OpenCV-2.3.1/modules/highgui/../core/include/opencv2/core/core.hpp:49,
from /home/fl/test/OpenCV-2.3.1/modules/highgui/include/opencv2/highgui/highgui.hpp:46,
from /home/fl/test/openarm/modules/highgui/precomp.hpp:51:
/usr/include/x86_64-linux-gnu/bits/mathinline.h: In member function 'virtual bool CvCapture_Images::setProperty(int, double)':
/usr/include/x86_64-linux-gnu/bits/mathinline.h:889:3: error: unknown register name 'st' in 'asm'
/usr/include/x86_64-linux-gnu/bits/mathinline.h:889:3: error: unknown register name 'st' in 'asm'
modules/highgui/CMakeFiles/opencv_highgui.dir/build.make:86: recipe for target 'modules/highgui/CMakeFiles/opencv_highgui.dir/src/cap_images.o' failed
make[2]: *** [modules/highgui/CMakeFiles/opencv_highgui.dir/src/cap_images.o] Error 1
CMakeFiles/Makefile2:1247: recipe for target 'modules/highgui/CMakeFiles/opencv_highgui.dir/all' failed
make[1]: *** [modules/highgui/CMakeFiles/opencv_highgui.dir/all] Error 2
Makefile:127: recipe for target 'all' failed
make: *** [all] Error 2

上面是我指定的路径,但是总是出现去找/usr/include目录,请问大神怎么解决啊。。换了几个版本的cmake-gui都一样,按理应该是去找usr/local/toolschain/4.5.1/中的交叉编译头文件的,但是感觉没什么用
...全文
802 5 打赏 收藏 转发到动态 举报
写回复
用AI写文章
5 条回复
切换为时间正序
请发表友善的回复…
发表回复
H317945 2020-01-19
  • 打赏
  • 举报
回复
你好,我也遇到了这个问题。我引用了第三方的源代码文件,编译的时候和编译器的头文件有定义冲突,如何让cmake不去系统路径下查找,请帮忙解答。
Fu_Lin_ 2016-03-24
  • 打赏
  • 举报
回复
引用 3 楼 alinly 的回复:
在编译器后面添加, 或者 在makefile中某个变量中添加,
你这样不行,添加是效果的,不过我现在出现了一个新的错误,不知道你懂吗? /usr/bin/ld: ../../3rdparty/lib/libzlib.a(gzclose.c.o):普通ELF重定位(M: 40) ../../3rdparty/lib/libzlib.a: 无法添加符号: 文件格式错误 collect2: error: ld returned 1 exit status modules/core/CMakeFiles/opencv_core.dir/build.make:686: recipe for target 'lib/libopencv_core.so.2.4.3' failed
alinly 2016-03-23
  • 打赏
  • 举报
回复
在编译器后面添加, 或者 在makefile中某个变量中添加,
Fu_Lin_ 2016-03-23
  • 打赏
  • 举报
回复
引用 1 楼 alinly 的回复:
makefile 中添加 -I path.to.real
请问是在哪个位置添加啊?
alinly 2016-03-23
  • 打赏
  • 举报
回复
makefile 中添加 -I path.to.real

23,114

社区成员

发帖
与我相关
我的任务
社区描述
Linux/Unix社区 应用程序开发区
社区管理员
  • 应用程序开发区社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧