« Asort for MawkBuild a kernel 2.6 »

Link statically only some specific libraries to a binary

13.12.11

Permalink 05:35:00 pm, by mazet Email , 32 words   English (US) latin1
Categories: Programmation, C

Link statically only some specific libraries to a binary

You could also use ld options -Bstatic and -Bdynamic

gcc mixer.o \
    -Wl,-Bstatic -lapplejuice \
    -Wl,-Bdynamic -lorangejuice \
    -o multifruitjuice

All libraries after it (including system ones linked by gcc automatically) will be linked dynamically.

No feedback yet