help-make
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Order of linking libraries


From: Paul Smith
Subject: Re: Order of linking libraries
Date: Thu, 12 Jul 2007 03:53:12 -0400

The first thing to say is that this has nothing whatever to do with GNU
make.  For help with linking issues you should contact a group related
to your compiler/linker toolchain; in this case GCC.

Second, if you don't want to mess with special linker flags you can use
the tried and true method of listing the libraries multiple times.  If
libA and libB are mutually referenced, just do something like:

        gcc -o foo -lA -lB -lA -lB

It's remotely possible you'd need to list them more than twice, but I've
never seen a case of this in real life.

Plus this will work with all linkers, just just the GNU linker.

-- 
-------------------------------------------------------------------------------
 Paul D. Smith <address@hidden>          Find some GNU make tips at:
 http://www.gnu.org                      http://make.paulandlesley.org
 "Please remain calm...I may be mad, but I am a professional." --Mad Scientist




reply via email to

[Prev in Thread] Current Thread [Next in Thread]