Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

with static linking, the order of libraries matters. e.g. anything, that depends on core has to go before that.

also, you now have to link against all needed 3rd party and system libs now.

last time i tried, it looked like this:

g++ my.cpp -I. -Ic:\p\opencv\build -Ic:\p\opencv\build\install\include -Lc:\p\opencv\build\install\x64\mingw\staticlib -lopencv_optflow340 -lopencv_bioinspired340 -lopencv_tracking340 -lopencv_plot340 -lopencv_datasets340 -lopencv_dnn340 -lopencv_face340 -lopencv_xfeatures2d340 -lopencv_features2d340 -lopencv_calib3d340 -lopencv_flann340 -lopencv_objdetect340 -lopencv_ml340 -lopencv_photo340 -lopencv_video340 -lopencv_videoio340 -lopencv_highgui340 -lopencv_imgcodecs340 -lopencv_ximgproc340 -lopencv_imgproc340 -lopencv_core340  -llibprotobuf -lkernel32 -lgdi32 -lwinspool -lshell32 -lole32 -loleaut32 -luuid -lcomdlg32 -ladvapi32 -lvfw32 -llibpng -llibjpeg -lopengl32 -lglu32 -luser32 -lz -lgcov -O3 -o my.cpp