Dave's Brain

Browse - Programming Tips - Normally you want to link to shared (.so) files. You do that

Date: 2011dec7
OS: Linux
Product: Jam
Keywords: shared, Jamfile, .a, static, archive

Q.  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 ;

Add a comment

Sign in to add a comment
Copyright © 2008-2017, dave - Code samples on Dave's Brain is licensed under the Creative Commons Attribution 2.5 License. However other material, including English text has all rights reserved.