How to include external header/libs?

Hi

I would like to link to external static libs (.a) and header files into my oF projects. I am not sure how to do this using config.make. Is there somewhere i can read which gives more details about this?

Thanks

Hey,
i usually write an addon, even if i wanna just include a library.
header files (and static libs) should be linked automatically, if structured correctly. Not sure if there is a better documentation, but there is an ofxAddonTemplate and some pretty complex addon config files, e.g. ofxOpenCv that should give you an idea how to write an addon.

Hope that helps
T

1 Like

Thank s for that ! is there a simpler way of just specifying libs in config.cmake , similar to this thread? I am not familar with oF or addons so it will take me quite some effort to get it setup

Linux lib headers seem like they end up in /usr/include/ after installing them from a repository. To use these kinds with oF, the config.make can be modified like this:

# uncomment the following in config.make and add a flag to link a library, the tbb library in this case
PROJECT_LDFLAGS=-Wl,-rpath=./libs
PROJECT_LDFLAGS+= -ltbb

# maybe add a path if needed with the following
# PROJECT_EXTERNAL_SOURCE_PATHS = 

The addons have some super nice advantages. They’re self-contained, portable, easy to update or modify, and easy to use.

Thanks for info !