Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

for static linking, the order of libs matters, you have to sort them by dependancy.

if opencv_aruco depends on opencv_core, aruco has to go before core. you'll also need a ton of system libs, that were conveniently linked to you're so's before. here's a working (4.1.0) example:

 g++ -std=c++0x src/cv.cpp -I ocv4/include/opencv4 -L ocv4/lib -L ocv4/lib/opencv4/3rdparty -O3 -lopencv_aruco -lopencv_imgcodecs -lopencv_calib3d -lopencv_ccalib -lopencv_xfeatures2d -lopencv_features2d -lopencv_xobjdetect -lopencv_dnn -lopencv_flann -lopencv_ml -lopencv_objdetect -lopencv_photo -lopencv_reg -lopencv_xphoto -lopencv_stitching -lopencv_superres -lopencv_bgsegm -lopencv_face -lopencv_saliency -lopencv_stitching -lopencv_superres -lopencv_tracking -lopencv_video -lopencv_ximgproc -lopencv_shape -lopencv_text -lopencv_optflow -lopencv_bioinspired -lopencv_imgproc -lopencv_core -littnotify -ljpeg -llibwebp -lrt -ldl -lz -lpthread -o src/cv