我使用的Codeblocks 16.01與OpenCV 3.2.0-vc14安裝到C:\ opencv 編譯和鏈接搜索目錄已在CodeBlocks中設置。在CodeBlocks中使用OpenCV庫
我寫了OpenCV的例子,有衝突如下:
-------------- Build: Debug in try_opencv (compiler: openCL)---------------
mingw32-g++.exe -L"C:\Program Files (x86)\Intel\OpenCL_SDK\6.3\lib\x86" -LC:\opencv\build\x64\vc14\lib -LC:\opencv\build\x64\vc14\bin -o bin\Debug\try_opencv.exe obj\Debug\main.o -lOpenCL C:\opencv\build\x64\vc14\lib\opencv_world320.lib C:\opencv\build\x64\vc14\lib\opencv_world320d.lib
obj\Debug\main.o: In function `main':
D:/TheOpenCLProgrammingBook/image_process_test/try_opencv/main.cpp:9: undefined reference to `cv::imread(cv::String const&, int)'
D:/TheOpenCLProgrammingBook/image_process_test/try_opencv/main.cpp:10: undefined reference to `cv::namedWindow(cv::String const&, int)'
D:/TheOpenCLProgrammingBook/image_process_test/try_opencv/main.cpp:11: undefined reference to `cv::imshow(cv::String const&, cv::_InputArray const&)'
D:/TheOpenCLProgrammingBook/image_process_test/try_opencv/main.cpp:12: undefined reference to `cv::waitKey(int)'
obj\Debug\main.o: In function `ZN2cv6StringC1EPKc':
C:/opencv/build/include/opencv2/core/cvstd.hpp:622: undefined reference to `cv::String::allocate(unsigned int)'
obj\Debug\main.o: In function `ZN2cv6StringD1Ev':
C:/opencv/build/include/opencv2/core/cvstd.hpp:664: undefined reference to `cv::String::deallocate()'
obj\Debug\main.o: In function `ZN2cv3MatD1Ev':
C:/opencv/build/include/opencv2/core/mat.inl.hpp:592: undefined reference to `cv::fastFree(void*)'
obj\Debug\main.o: In function `ZN2cv3MataSERKS0_':
C:/opencv/build/include/opencv2/core/mat.inl.hpp:613: undefined reference to `cv::Mat::copySize(cv::Mat const&)'
obj\Debug\main.o: In function `ZN2cv3Mat7releaseEv':
C:/opencv/build/include/opencv2/core/mat.inl.hpp:704: undefined reference to `cv::Mat::deallocate()'
collect2.exe: error: ld returned 1 exit status
Process terminated with status 1 (0 minute(s), 0 second(s))
10 error(s), 0 warning(s) (0 minute(s), 0 second(s))
它是如此迷茫。有人可以幫我嗎?
我知道了!謝謝邁克。 – okeyla