Date: 2011dec7
Update: 2025jul5
OS: Linux
Product: Jam
Keywords: shared, Jamfile, .a, static, archive, make
Q. Jam: Normally you want to link to shared (.so) files. You do that
by using the -l flag to the LINKFLAGS, like this:
LINKFLAGS = -L/usr/lib -pthread -lfam -lstdc++ ;
But what if you want to statically link to a library (.a)?
A. Use the LinkLibraries directive in your Jamfile. For example:
Main myprog : myprog.cpp ;
LinkLibraries myprog : libconfig-1.4.8/lib/.libs/libconfig.a ;
The spaces around the colon and before the semi-colon and other places ARE required!