Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

as long as you're linking dynamic libs, the order does not matter at all.

quite a different picture with static libs, since you have to sort them by dependancy. you also need to explicitly link to all dependancies (like e.g. zlib) which were conveniently linked to the so's when building the libs.

so, if you have :

-lopencv_core -lopencv_imgcodecs -lz -lpng

core has to go after imgcodecs, which depends on png, which depends on zlib, so it must be:

-lopencv_imgcodecs -lopencv_core -lpng  -lz