Boost logo

Boost Users :

Subject: Re: [Boost-users] Fwd: Getting ASIO application to link (undefined reference to `boost::system::generic_category()) (SOLVED)
From: Ulf Samuelsson (boost-user_at_[hidden])
Date: 2013-09-18 11:20:44


On 2013-09-18 12:47, Bjorn Reese wrote:
> On 09/18/2013 08:40 AM, Ulf Samuelsson wrote:
>
>> No, the solution is simple. The -l<library> must be AFTER the reference
>> to the object files.
>>
>> FAIL: g++ -lboost_system myfile.o
>> OK: g++ myfile.o -lboost_system
>>
>> Maybe there is a good reason for this.
>
> Many linkers are single-pass linkers because that gives better linking
> speed. See "The linking process" section of:
>
> http://eli.thegreenplace.net/2013/07/09/library-order-in-static-linking/
>
That still does not mean that you cannot parse a command line before
starting
the actual link process.

Maybe in obscure cases you want tighter control when a library can be used,
but it should IMHO be the exception.

BR
Ulf

> _______________________________________________
> Boost-users mailing list
> Boost-users_at_[hidden]
> http://lists.boost.org/mailman/listinfo.cgi/boost-users


Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net