未定义的引用'cvCreateKalman' [英] Undefined reference to 'cvCreateKalman'

查看:1394
本文介绍了未定义的引用'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屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆