Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

order of -lopencv_core -lopencv_highgui -lopencv_photo -lopencv_videoio -lopencv_imgproc -lopencv_calib3 reads:

-llibrary -l library

It makes a difference where in the command you write this option; the linker searches and processes libraries and object files in the order they are specified. Thus, ‘foo.o -lz bar.o’ searches library ‘z’ after file foo.o but before bar.o. If bar.o refers to functions in ‘z’, those functions may not be loaded.

The shared libraries, for example libopencv-video, require other libraries and themselves are required by other libraries.

Does this mean that in the compile command their order ( -lopencv_core -lopencv_highgui -lopencv_photo -lopencv_videoio -lopencv_imgproc -lopencv_calib3) matters?