My question is an extension of this question
I want to link against 2 libraries - foo
and bar
preferring static for foo and dynamic for bar. If I use
g++ -static -lfoo -lbar
it tries to find static archives for both foo and bar. When I change the command to
g++ -Wl,-Bstatic -lfoo -Wl,-Bdynamic -lbar -Wl,--as-needed
as per the above SO question, this is the error I get:
ld: unknown option: -Bstatic
Update: I am using OSX, if that makes any difference