Closed ghost closed 5 years ago
I have previously made a StackOverflow question more on this here https://stackoverflow.com/questions/51622111/opencv-c-mingw-vscode-fatal-error-to-compile?noredirect=1#comment90210559_51622111
This is the ld linker can't find cv.
g++ ./src/main.cpp -I C:/OpenCV-MinGW-Build-OpenCV-3.4.1-x64/include -L C:/OpenCV-MinGW-Build-OpenCV-3.4.1-x64/x64/mingw/bin -llibopencv_core341 -llibopencv_highgui341 -llibopencv_imgcodecs341 -o app
(see OpenCV : undefined reference to imread()) Can this work?
Answer:
MinGW libs from this repo are to be used with QT, so this will not work as they target a different compiler.
For Visual studio, I advise you to compile your own libraries following the link above.
I manage to use the MinGW build OpenCV with g++ and Visual Studio Code https://stackoverflow.com/a/51801863
I am completely noob on c++
I have cloned your repo x64 version
And when I run this command I get the error.
Command
g++ ./src/main.cpp -I C:/OpenCV-MinGW-Build-OpenCV-3.4.1-x64/include -L C:/OpenCV-MinGW-Build-OpenCV-3.4.1-x64/x64/mingw/lib -llibopencv_core341 -llibopencv_highgui341 -o app
Error