如果这里没有出现错误,想知道源代码并修复了我在Cygwin(Windows 7 64位)下构建OpenCV时出现的错误。OpenCV编译错误
我已经安装Cygwin与安装在cygwin安装中的MingW-pthread pacgae。
我已经下载了OpenCV ver。 2.3.1源码包。
编辑:
一些调整后,变更建设过程中的OpenCV现在建立的罚款。 但是,当我编译一个简单的测试openCV代码(C源代码),如下所示,它给很多基本的openCV函数提供了未定义引用的链接器错误。我试着正确设置LD_LIBRARY_PATH但还是错误persit:
cc -L/usr/local/lib -I/usr/local/include/opencv2 -/usr/local/include/opencv -lop encv_imgproc -lopencv_highgui -lopencv_video -lopencv_calib3d test1.c -o test_op encv
cc: unrecognized option '-/usr/local/include/opencv'
/tmp/ccfEqFK0.o:test1.c:(.text+0x9dd): undefined reference to `_cvFree_'
/tmp/ccfEqFK0.o:test1.c:(.text+0xa4e): undefined reference to `_cvFree_'
/tmp/ccfEqFK0.o:test1.c:(.text+0xb44): undefined reference to `_cvGetRows'
/tmp/ccfEqFK0.o:test1.c:(.text+0xb6f): undefined reference to `_cvGetCols'
/tmp/ccfEqFK0.o:test1.c:(.text+0xb82): undefined reference to `_cvReleaseMat'
/tmp/ccfEqFK0.o:test1.c:(.text+0xcd2): undefined reference to `_cvAddS'
/tmp/ccfEqFK0.o:test1.c:(.text+0x1137): undefined reference to `_cvRead'
/tmp/ccfEqFK0.o:test1.c:(.text+0x11e1): undefined reference to `_cvLoadImage'
/tmp/ccfEqFK0.o:test1.c:(.text+0x129d): undefined reference to `_cvCreateImage'
/tmp/ccfEqFK0.o:test1.c:(.text+0x12dd): undefined reference to `_cvResize'
/tmp/ccfEqFK0.o:test1.c:(.text+0x12f1): undefined reference to `_cvNamedWindow'
/tmp/ccfEqFK0.o:test1.c:(.text+0x1305): undefined reference to `_cvNamedWindow'
'
/tmp/ccfEqFK0.o:test1.c:(.text+0x13ad): undefined reference to `_cvDestroyWindow
......还有更多的未定义的引用。
'
collect2: ld returned 1 exit status
Makefile:10: recipe for target `test_opencv' failed
make: *** [test_opencv] Error 1
编辑
下面的消息仍然存在,但它不是一个错误,但在构建过程中的消息。
*然后同时在cygwin下构建的OpenCV,当我作,它给出了一个错误消息 C++:无法识别的选项 '-pthread' [36%]建筑CXX对象模块/ highgui/CMakeFiles/opencv_highgui.dir/SRC /grfmt_sunras.o*
和其他许多文件,我看到了同样的错误c++: unrecognized option '-pthread'
我想知道是否有人有在Cygwin下构建OpenCV的经验,如何让OpenCV的在Cygwin的打算? 。现在我知道有OpenCV的Windows设置,但这不是我的选择。
它应该是** - ** lpthread代替! – karlphillip 2012-02-21 11:18:12