未定义的引用'cvCreateKalman' [英] Undefined reference to 'cvCreateKalman'
问题描述
我一直在开发一个简单的Qt C ++ OpenCV应用程序,我想集成卡尔曼滤波器。
我包括:
opencv / cv.h; opencv / highgui.h和opencv / cxcore.h;
在我的.pro文件中我有:
< blockquote>
INCLUDEPATH + = -I / usr / include / opencv LIBS + = -lopencv_core \
-lopencv_highgui \
-lopencv_imgproc
但是,当我这样做 CvKalman * kalman = cvCreateKalman(8,4,0);
我只是得到undefined引用 cvCreateKalman
和collect2:ld返回1退出状态。编译输出不提供其他信息。
我尝试在线查找帮助,但Google没有真正的帮助。我也试图包括额外的 OpenCV
libs像ml或对象跟踪,但没有发生任何事情。
对我来说,自从加载原始的libs ...之后, CvKalman
和 cvCreateKalman
>
任何帮助将非常感谢!
感谢。
在 INCLUDEPATH
中,像这样,
INCLUDEPATH + = / usr / include / opencv
并将模块添加到LIBS中,像这样
: LIBS + = -L / usr / lib -lopencv_core -lopencv_highgui -lopencv_imgproc
>
I've been working on a simple Qt C++ OpenCV app and I want to integrate a Kalman filter. I include:
opencv/cv.h;opencv/highgui.h and opencv/cxcore.h;
in my .pro file I have:
INCLUDEPATH += -I/usr/include/opencv LIBS += -lopencv_core \ -lopencv_highgui \ -lopencv_imgproc
However, when I do this CvKalman* kalman = cvCreateKalman(8,4,0);
I just get undefined reference to cvCreateKalman
and collect2: ld returned 1 exit status. Compile output doesn't provide additional info.
I tried finding help online but Google wasn't really helpful. I also tried to include additional OpenCV
libs like ml or object tracking but nothing happened.
It seems a bit weird to me that CvKalman
and cvCreateKalman
are available in the autocomplete since right after loading the original libs...
Any help would be greatly appreciated! Thanks.
In INCLUDEPATH
, Specify your library like this,
INCLUDEPATH += /usr/include/opencv
And add the modules to LIBS vaiable like this,
LIBS += -L/usr/lib -lopencv_core -lopencv_highgui -lopencv_imgproc
This should work.
这篇关于未定义的引用'cvCreateKalman'的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!