Pre-compiled static libraries


#1

Hi,

I wanted to know if it is possible to use some pre-compiled static libraries and related header files and reference them in a code which is in src directory.

Best,
DP


#2

Please take a look at build_flags.

[env:specific_inclibs]
build_flags = -I/opt/include -L/opt/lib -lfoo

#3

Ahh…thanks, I almost forgot about it.


#4

So I have library someLib.a, that I would like to use in my project. Will be my command look like:
[env:specific_inclibs]
build_flags = -L/folderToLibrary -lsomeLib

?


#5

Yes, you are right. You need 2 things:

  • add a path where mylib.a archive is located via -L ...
  • add extra path to CPPATH where are located headers files via -I ...
  • add precompiled library to linker via -l mylib.