mingw
和eclipse
工作正常。我尝试设置OpenCV
并构建我的项目,但收到以下错误。我没有任何线索来解决这个问题..我谷歌但没有运气。
12:21:54 **** Rebuild of configuration Debug for project VideoBackGroundRemoval ****
Info: Internal Builder is used for build
g++ "-IE:\\opencv\\build\\include\\" -O0 -g3 -Wall -c -fmessage-length=0 -o "src\\main.o" "..\\src\\main.cpp"
g++ "-LE:\\opencv\\minGW\\x86" -o VideoBackGroundRemoval.exe "src\\main.o" "-lE:\\opencv\\minGW\\x86\\bin\\libopencv_flann2410" "-lE:\\opencv\\minGW\\x86\\bin\\libopencv_gpu2410.dll" "-lE:\\opencv\\minGW\\x86\\bin\\libopencv_highgui2410.dll" "-lE:\\opencv\\minGW\\x86\\bin\\libopencv_imgproc2410.dll" "-lE:\\opencv\\minGW\\x86\\bin\\libopencv_ml2410.dll" "-lE:\\opencv\\minGW\\x86\\bin\\libopencv_legacy2410.dll" "-lE:\\opencv\\minGW\\x86\\bin\\libopencv_nonfree2410.dll" "-lE:\\opencv\\minGW\\x86\\bin\\libopencv_objdetect2410.dll" "-lE:\\opencv\\minGW\\x86\\bin\\libopencv_ocl2410.dll" "-lE:\\opencv\\minGW\\x86\\bin\\libopencv_photo2410.dll" "-lE:\\opencv\\minGW\\x86\\bin\\libopencv_stitching2410.dll" "-lE:\\opencv\\minGW\\x86\\bin\\libopencv_superres2410.dll" "-lE:\\opencv\\minGW\\x86\\bin\\libopencv_video2410.dll" "-lE:\\opencv\\minGW\\x86\\bin\\libopencv_videostab2410.dll" "-lE:\\opencv\\minGW\\x86\\bin\\opencv_ffmpeg2410.dll" "-lE:\\opencv\\minGW\\x86\\bin\\libopencv_ml2410.dll" "-lE:\\opencv\\minGW\\x86\\bin\\libopencv_calib3d2410.dll" "-lE:\\opencv\\minGW\\x86\\bin\\libopencv_contrib2410.dll" "-lE:\\opencv\\minGW\\x86\\bin\\libopencv_core2410.dll"
e:/mingw/bin/../lib/gcc/mingw32/4.8.1/../../../../mingw32/bin/ld.exe: cannot find -lE:\opencv\minGW\x86\bin\libopencv_flann2410
e:/mingw/bin/../lib/gcc/mingw32/4.8.1/../../../../mingw32/bin/ld.exe: cannot find -lE:\opencv\minGW\x86\bin\libopencv_gpu2410.dll
e:/mingw/bin/../lib/gcc/mingw32/4.8.1/../../../../mingw32/bin/ld.exe: cannot find -lE:\opencv\minGW\x86\bin\libopencv_highgui2410.dll
e:/mingw/bin/../lib/gcc/mingw32/4.8.1/../../../../mingw32/bin/ld.exe: cannot find -lE:\opencv\minGW\x86\bin\libopencv_imgproc2410.dll
e:/mingw/bin/../lib/gcc/mingw32/4.8.1/../../../../mingw32/bin/ld.exe: cannot find -lE:\opencv\minGW\x86\bin\libopencv_ml2410.dll
e:/mingw/bin/../lib/gcc/mingw32/4.8.1/../../../../mingw32/bin/ld.exe: cannot find -lE:\opencv\minGW\x86\bin\libopencv_legacy2410.dll
e:/mingw/bin/../lib/gcc/mingw32/4.8.1/../../../../mingw32/bin/ld.exe: cannot find -lE:\opencv\minGW\x86\bin\libopencv_nonfree2410.dll
e:/mingw/bin/../lib/gcc/mingw32/4.8.1/../../../../mingw32/bin/ld.exe: cannot find -lE:\opencv\minGW\x86\bin\libopencv_objdetect2410.dll
e:/mingw/bin/../lib/gcc/mingw32/4.8.1/../../../../mingw32/bin/ld.exe: cannot find -lE:\opencv\minGW\x86\bin\libopencv_ocl2410.dll
e:/mingw/bin/../lib/gcc/mingw32/4.8.1/../../../../mingw32/bin/ld.exe: cannot find -lE:\opencv\minGW\x86\bin\libopencv_photo2410.dll
e:/mingw/bin/../lib/gcc/mingw32/4.8.1/../../../../mingw32/bin/ld.exe: cannot find -lE:\opencv\minGW\x86\bin\libopencv_stitching2410.dll
e:/mingw/bin/../lib/gcc/mingw32/4.8.1/../../../../mingw32/bin/ld.exe: cannot find -lE:\opencv\minGW\x86\bin\libopencv_superres2410.dll
e:/mingw/bin/../lib/gcc/mingw32/4.8.1/../../../../mingw32/bin/ld.exe: cannot find -lE:\opencv\minGW\x86\bin\libopencv_video2410.dll
e:/mingw/bin/../lib/gcc/mingw32/4.8.1/../../../../mingw32/bin/ld.exe: cannot find -lE:\opencv\minGW\x86\bin\libopencv_videostab2410.dll
e:/mingw/bin/../lib/gcc/mingw32/4.8.1/../../../../mingw32/bin/ld.exe: cannot find -lE:\opencv\minGW\x86\bin\opencv_ffmpeg2410.dll
e:/mingw/bin/../lib/gcc/mingw32/4.8.1/../../../../mingw32/bin/ld.exe: cannot find -lE:\opencv\minGW\x86\bin\libopencv_ml2410.dll
e:/mingw/bin/../lib/gcc/mingw32/4.8.1/../../../../mingw32/bin/ld.exe: cannot find -lE:\opencv\minGW\x86\bin\libopencv_calib3d2410.dll
e:/mingw/bin/../lib/gcc/mingw32/4.8.1/../../../../mingw32/bin/ld.exe: cannot find -lE:\opencv\minGW\x86\bin\libopencv_contrib2410.dll
e:/mingw/bin/../lib/gcc/mingw32/4.8.1/../../../../mingw32/bin/ld.exe: cannot find -lE:\opencv\minGW\x86\bin\libopencv_core2410.dll
collect2.exe: error: ld returned 1 exit status
12:21:55 Build Finished (took 999ms)
答案 0 :(得分:0)
为什么你的-l ...引用包含DLL文件的完整路径名?如果路径不是编译器自动搜索的路径,则目录路径属于-L ...规范,只有DLL文件的基本名称(没有扩展名)属于-l ..规范。
另请注意,gcc通常会添加一个' lib'前缀,' .a',' .lib',或' .dll'后缀,甚至是.dll.a后缀,指定您使用-l ...指定的名称;有关MinGW编译器/链接器将搜索的名称的确切顺序的详细信息,请参阅{{3>}处的标题直接链接到dll 。