This is the mail archive of the gcc-help@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: statically link some libraries and dynamically link others?


Hi Frank,

>Is it possible to statically link some libraries and dynamically link
others?

Yes.

I do it like this, e.g.:

g++ -o foo \
  foo.cpp bar.cpp quux.cpp \
  -Wl,-Bstatic -lstdc++ -lgcc \
  -Wl,-Bdynamic -lsocket -lc -lm

Sincerely,
--Eljay



Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]