当前位置: 代码迷 >> QT开发 >> 非常奇怪,qt-creator下找不到头文件,该如何解决
  详细解决方案

非常奇怪,qt-creator下找不到头文件,该如何解决

热度:45   发布时间:2016-04-25 05:00:31.0
非常奇怪,qt-creator下找不到头文件
我的虚拟机linux下的qt-creator,里面有x11版本和qte-4.7.2两个编译器(已经编译好了。)
  我本来已经在x11下面的把程序编译成功,没有任何错误,程序运行正常。然后我想把程序编程成ARM板可以运行的格式,一换成qte-4.7.2的编译器,竟然说no such file or directory!
  我就不明白,我X11下都能编译成功,怎么一到QTE4.7.2就找不到路径呢?

我发现是opencv的头文件找不到

In file included from main.cpp:3:
dialog.h:5:46: error: usr/local/include/opencv/highgui.h: No such file or directory
dialog.h:6:41: error: usr/local/include/opencv/cv.h: No such file or directory
In file included from main.cpp:3:
dialog.h:33: error: ISO C++ forbids declaration of 'IplImage' with no type
dialog.h:33: error: expected ';' before '*' token
dialog.h:34: error: ISO C++ forbids declaration of 'IplImage' with no type
dialog.h:34: error: expected ';' before '*' token
dialog.h:35: error: ISO C++ forbids declaration of 'IplImage' with no type
dialog.h:35: error: expected ';' before '*' token
dialog.h:36: error: ISO C++ forbids declaration of 'IplImage' with no type
dialog.h:36: error: expected ';' before '*' token
dialog.h:37: error: ISO C++ forbids declaration of 'IplImage' with no type
dialog.h:37: error: expected ';' before '*' token
dialog.h:41: error: 'IplImage' has not been declared 

但是我之前在x11的编译下都能通过,也可以找到cv.h和highgui.h的,现在为什么找不到?
我在.pro下已经加了
INCLUDEPATH +=./usr/local/include/opencv
LIBS += /usr/local/lib/libcv.so\
  /usr/local/lib/libcvaux.so\
  /usr/local/lib/libcxcore.so\
  /usr/local/lib/libhighgui.so\
  /usr/local/lib/libml.so\

请告诉我什么原因,该怎么做?

------解决方案--------------------
探讨

引用:

应该是环境变量的问题

你是说$LD_LIBRARY_PATH是吗?
  相关解决方案