Search code examples
c++linuxeclipseembedded-linuxxilinx-edk

Static library, link to a shared library


I'm new to using Eclipse and developing an application that will be running on Linux (on an ARM processor). I want to use the OpenCV libraries (.so files). My application consists of an executable that links to multiple static libraries. This linkage is configured in the IDE settings (ARM linux g++ linker settings). I need to use openCV within one of these static libraries. The openCV libraries are included as .so files installed with the Xilinx Eclipse SDK. Is it possible to link to these libraries from within my static library? I'm not sure how to set this up. Obviously there are no g++ linker settings in the static library project. Thanks for any help.


Solution

  • On linux a static libary is really nothing more than a collection of object files smacked together, therefore you cannot link it, but you do not need to either. As the static library isn't linked at all.

    The solution is to link your final executable to both libraries. You are of course able to use OpenCV functions inside your static library, it will simply wait to be resolved at a later time.