如果這裏沒有出現錯誤,想知道源代碼並修復了我在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