[boost] How to correct when Auto-link gets it wrong in VS

1,266 views
Skip to first unread message

Paul Bergen

unread,
Dec 4, 2010, 4:06:25 PM12/4/10
to bo...@lists.boost.org
I installed boost both with bjam and with the BoostPro installer, both
times with the same option. I specified that it should install as
Multi-Threaded Debug DLL. I'm using Visual Studio 2008 EE. I
followed the steps here:
http://www.boost.org/doc/libs/1_45_0/more/getting_started/windows.html

But Visual Studio won't link, it says it can't find:
libboost_system-vc90-mt-sgd-1_44.lib, which is because the file really
is: boost_system-vc90-mt-gd-1_44.lib

According to this page:
http://www.boost.org/doc/libs/1_45_0/more/getting_started/windows.html#library-naming
the problem is that VS is trying to find the static library, although
I installed the dynamic one. I can't find in the getting_started
where you tell VS which version to use.

Thanks.
_______________________________________________
Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost

Steven Watanabe

unread,
Dec 4, 2010, 4:48:38 PM12/4/10
to bo...@lists.boost.org
AMDG

On 12/4/2010 1:06 PM, Paul Bergen wrote:
> I installed boost both with bjam and with the BoostPro installer, both
> times with the same option. I specified that it should install as
> Multi-Threaded Debug DLL. I'm using Visual Studio 2008 EE. I
> followed the steps here:
> http://www.boost.org/doc/libs/1_45_0/more/getting_started/windows.html
>
> But Visual Studio won't link, it says it can't find:
> libboost_system-vc90-mt-sgd-1_44.lib, which is because the file really
> is: boost_system-vc90-mt-gd-1_44.lib
>
> According to this page:
> http://www.boost.org/doc/libs/1_45_0/more/getting_started/windows.html#library-naming
> the problem is that VS is trying to find the static library, although
> I installed the dynamic one. I can't find in the getting_started
> where you tell VS which version to use.

compile with -DBOOST_ALL_DYN_LINK

In Christ,
Steven Watanabe

Thomas Klimpel

unread,
Dec 5, 2010, 11:11:07 AM12/5/10
to bo...@lists.boost.org
On 12/4/2010 1:06 PM, Paul Bergen wrote:
> I installed boost both with bjam and with the BoostPro installer, both
> times with the same option. I specified that it should install as
> Multi-Threaded Debug DLL. I'm using Visual Studio 2008 EE. I
> followed the steps here:
> http://www.boost.org/doc/libs/1_45_0/more/getting_started/windows.html
>
> But Visual Studio won't link, it says it can't find:
> libboost_system-vc90-mt-sgd-1_44.lib, which is because the file really
> is: boost_system-vc90-mt-gd-1_44.lib
>
> According to this page:
> http://www.boost.org/doc/libs/1_45_0/more/getting_started/windows.html#library-naming
> the problem is that VS is trying to find the static library, although
> I installed the dynamic one. I can't find in the getting_started
> where you tell VS which version to use.

compile with -DBOOST_ALL_NO_LIB
to disable auto-linking completely. This also solves the problem that a header only library like ublas tries to autolink against serialization, just because somebody provided serialization functionality for the header only library.

Regards,
Thomas

John Maddock

unread,
Dec 5, 2010, 11:31:14 AM12/5/10
to bo...@lists.boost.org
>> According to this page:
>> http://www.boost.org/doc/libs/1_45_0/more/getting_started/windows.html#library-naming
>> the problem is that VS is trying to find the static library, although
>> I installed the dynamic one. I can't find in the getting_started
>> where you tell VS which version to use.
>
> compile with -DBOOST_ALL_NO_LIB
> to disable auto-linking completely. This also solves the problem that a
> header only library like ublas tries to autolink against serialization,
> just because somebody provided serialization functionality for the header
> only library.

True, but you'd better way be sure to link against the correct import lib...
otherwise don't come running to us! ;)

John.

Mathias Gaunard

unread,
Dec 5, 2010, 11:50:25 AM12/5/10
to bo...@lists.boost.org
On 05/12/2010 17:11, Thomas Klimpel wrote:

> This also solves the problem that a header only library like ublas tries to autolink against serialization, just because somebody provided serialization functionality for the header only library.

Auto-linking against a particular depencendy should only be done if you
include the header that triggers that dependency.

Robert Ramey

unread,
Dec 5, 2010, 3:55:58 PM12/5/10
to bo...@lists.boost.org
Mathias Gaunard wrote:
> On 05/12/2010 17:11, Thomas Klimpel wrote:
>
>> This also solves the problem that a header only library like ublas
>> tries to autolink against serialization, just because somebody
>> provided serialization functionality for the header only library.
>
> Auto-linking against a particular depencendy should only be done if
> you include the header that triggers that dependency.

Actually, I believe that you only trigger the dependency if you
actually invoke some function in the library. At least that's the
way it should be.

Robert Ramey.

Steven Watanabe

unread,
Dec 6, 2010, 1:51:57 AM12/6/10
to bo...@lists.boost.org
AMDG

On 12/5/2010 12:55 PM, Robert Ramey wrote:


> Mathias Gaunard wrote:
>> Auto-linking against a particular depencendy should only be done if
>> you include the header that triggers that dependency.
> Actually, I believe that you only trigger the dependency if you
> actually invoke some function in the library. At least that's the
> way it should be.

This isn't possible, since auto-linking is done
with a #pragma. I don't know of a way to make it
dependent on actually calling a library function.

In Christ,
Steven Watanabe

Reply all
Reply to author
Forward
0 new messages