2010-09-17 86 views
1

我有一个编译问题,我无法找出在c + +中的OpenCV2.1。OpenCV,eclipse编译问题

下面是一个简单的测试代码我试图编译:

#include <iostream> 
#include "cv.h" 

using namespace std; 

int main() { 
    cout << "Hello World" << endl; // prints !!!Hello World!!! 
    cv::Mat mtx; 
    return 0; 
} 

我具有未定义参考编译错误如下

**** Build of configuration Debug for project CJMVideo **** 

**** Internal Builder is used for build    **** 
g++ -IC:\OpenCV2.1\include\opencv -IC:\Program Files\Point Grey Research\FlyCapture2\include -O0 -g3 -Wall -c -fmessage-length=0 -osrc\CJMVideo.o ..\src\CJMVideo.cpp 
g++ -LC:\OpenCV2.1\lib -LC:\Program Files\Point Grey Research\FlyCapture2\lib64 -Xlinker --enable-auto-import -oCJMVideo.exe src\CJMVideo.o -lcxcore210 -lcv210 -lhighgui210 -lml210 -lFlyCapture2 
src\CJMVideo.o:C:/OpenCV2.1/include/opencv/cxmat.hpp:378: undefined reference to `cv::fastFree(void*)' 
collect2: ld returned 1 exit status 
Build error occurred, build is stopped 
Time consumed: 1438 ms. 

的误差C:/OpenCV2.1 /include/opencv/cxmat.hpp:378:未定义的引用`cv :: fastFree(void *)'

我相信我已经正确编译所有库上面的命令...有什么问题?

感谢

回答

1

即使消息表明,它并没有发现OpenCV的库,符号,我必须指出,从上面粘贴的命令行,看来你是想你的应用程序对64位链接编译的库,如-LC:\Program Files\Point Grey Research\FlyCapture2\lib64所示。这意味着您必须将OpenCV编译为64位,或者将它们编译为32位。

您可能缺少一个库。在Windows上,我的OpenCV项目通常会添加cv210.lib cvaux210.lib cxcore210.lib cxts210.lib highgui210.lib,但我大部分时间都使用Visual Studio 2005。

1

我在使用intel TBB并行库构建OpenCV lib时无法连接TBB,因此链接cv :: fastfree时出现问题