Closed runsys closed 5 years ago
The linker could not find opencv library (libopencv_*.dll for VC, libopencv_*.dll.a for GCC)
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
/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
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
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