huihut / OpenCV-MinGW-Build

👀 MinGW 32bit and 64bit version of OpenCV compiled on Windows. Including OpenCV 3.3.1, 3.4.1, 3.4.1-x64, 3.4.5, 3.4.6, 3.4.7, 3.4.8-x64, 3.4.9, 4.0.0-alpha-x64, 4.0.0-rc-x64, 4.0.1-x64, 4.1.0, 4.1.0-x64, 4.1.1-x64, 4.5.0-with-contrib, 4.5.2-x64
https://opencv.org/
963 stars 219 forks source link

wenrjianr diusir #8

Closed runsys closed 5 years ago

runsys commented 5 years ago

m:/work/tool/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/4.8.2/../../../../x86_64-w64-mingw32/bin/ld.exe: cannot find -lopencv_face410 m:/work/tool/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/4.8.2/../../../../x86_64-w64-mingw32/bin/ld.exe: cannot find -lopencv_xfeatures2d410 m:/work/tool/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/4.8.2/../../../../x86_64-w64-mingw32/bin/ld.exe: cannot find -lopencv_plot410 m:/work/tool/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/4.8.2/../../../../x86_64-w64-mingw32/bin/ld.exe: cannot find -lopencv_tracking410 m:/work/tool/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/4.8.2/../../../../x86_64-w64-mingw32/bin/ld.exe: cannot find -lopencv_img_hash410

huihut commented 5 years ago

The linker could not find opencv library (libopencv_*.dll for VC, libopencv_*.dll.a for GCC)

Vinobharathi369 commented 5 years ago

The linker could not find opencv library (libopencv*.dll for VC, libopencv*.dll.a for GCC)

* You should declare the library path
g++ -L/path/to/OpenCV-MinGW-Build/x64/mingw/lib -lopencv_face -lopencv_xfeatures2d -lopencv_plot -lopencv_tracking -lopencv_img_hash yourprogram.cpp -o  yourprogram
* Or you can set the library path(`/path/to/OpenCV-MinGW-Build/x64/mingw/lib`) to the environment variable and take effect, then
g++ -lopencv_face -lopencv_xfeatures2d -lopencv_plot -lopencv_tracking -lopencv_img_hash yourprogram.cpp -o  yourprogram

I tried but not working

huihut commented 5 years ago

Maybe you can try @anysz ‘s solution, and extend opencv_contrib.