|
Boost Users : |
Subject: Re: [Boost-users] linking to boost 1.54 w/ windows and visual studio 2013 RC
From: Lars Viklund (zao_at_[hidden])
Date: 2013-09-25 02:12:33
On Tue, Sep 24, 2013 at 01:03:50PM -0400, Jarrett Chisholm wrote:
> Hi all
>
> I'm trying to compile my project as a shared library using scons. I'm
> using Windows 7, and the Visual Studio 2013 RC. In the project, I'm
> using boost.
>
> The project compiles fine. However, when it tries to link, I get the
> following:
> //LINK : fatal error LNK1104: cannot open file
> 'libboost_log-vc110-mt-1_54.lib'//
>
> I'm curious why it's trying to link to `libboost_log-vc110-mt-1_54.lib`
> instead of `libboost_log-vc120-mt-1_54.lib`, which is what I specified
> in the link command. Also, as far as I can tell, `vcxxx` is the
> compiler tag boost uses to tell what version of the compiler built the
> boost library...so it's almost like `scons` thinks boost was built using
> Visual Studio 2012, which would be `vc110`...I'm not sure.
With MSVC, Boost.Config offers "autolink" functionality, which
determines the toolset name from the perceived compiler version and
emits #pragma comment(lib,"libboost-blargh.lib") pragmas to make the
linker automagically link the right library.
The problem lies in that 1.54 doesn't really have any awareness of
2013Preview/RC/RTM at all, which means that it'll assume that anything
over 1700 is "vc110".
There are several solutions to this problem:
(a) define BOOST_LIB_TOOLSET to "vc120"
(b) apply the patch from [1] to teach Boost.Config about the compiler
(c) define BOOST_ALL_NO_LIB to inhibit autolinking
In general, there's a lot of fun little hacks that you need to apply to
1.54 and trunk in order to get Boost working much at all with 2013. Some
of them are in [2], and a few of them are applied to trunk Boost.Build
and Boost.
[1] https://svn.boost.org/trac/boost/attachment/ticket/8753/0001-Boost.Config-add-Visual-Studio-2013-to-autolink-toolsets.patch
[2] http://lists.boost.org/Archives/boost/2013/07/204953.php
-- Lars Viklund | zao_at_[hidden]
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