Boost logo

Boost-Build :

Subject: [Boost-build] building release attempts to link against debug boost libs
From: JohnnyJuggernaut (johnnynin_at_[hidden])
Date: 2010-05-22 20:42:39


When I build debug, everything builds perfectly. However, when I build
release I can see from the verbose output that the correct libs are
searched, followed by the debug libs which results in error.

In the output below, the correct lib should be
libboost_thread-vc90-mt-s-1_42.lib
which it finds, but then it also tries to find
libboost_thread-vc90-mt-sgd-1_42.lib

I'm very new to boost.build, so apologies if I'm doing something boneheaded.

build output:

msvc.link
bin\msvc-9.0express\release\architecture-x86\link-static\runtime-link-static\threading-multi\server.exe

Searching libraries
    Searching
\boost\boost_1_42_0\bin.v2\libs\thread\build\msvc-9.0express\release\architecture-x86\link-static\runtime-link-static\threading-multi\libboost_thread-vc90-mt-s-1_42.lib:
    Searching
\boost\boost_1_42_0\bin.v2\libs\date_time\build\msvc-9.0express\release\architecture-x86\link-static\runtime-link-static\threading-multi\libboost_date_time-vc90-mt-s-1_42.lib:
    Searching
\boost\boost_1_42_0\bin.v2\libs\filesystem\build\msvc-9.0express\release\architecture-x86\link-static\runtime-link-static\threading-multi\libboost_filesystem-vc90-mt-s-1_42.lib:
    Searching
..\lib\bin\msvc-9.0express\release\architecture-x86\link-static\runtime-link-static\threading-multi\libcuo.lib:
    Searching ..\libcuo.lib:
    Searching
\boost\boost_1_42_0\bin.v2\libs\system\build\msvc-9.0express\release\architecture-x86\link-static\runtime-link-static\threading-multi\libboost_system-vc90-mt-s-1_42.lib:
    Searching C:\Program Files\Microsoft SDKs\Windows\v6.0A\lib\ws2_32.lib:
    Searching C:\Program Files\Microsoft Visual Studio
9.0\VC\LIB\libcpmtd.lib:
    Searching C:\Program Files\Microsoft Visual Studio
9.0\VC\LIB\LIBCMTD.lib:
    Searching C:\Program Files\Microsoft Visual Studio
9.0\VC\LIB\OLDNAMES.lib:
LINK : fatal error LNK1104: cannot open file
'libboost_thread-vc90-mt-sgd-1_42.lib'

        call "C:\Program Files\Microsoft Visual Studio 9.0\VC\vcvarsall.bat"
x86 >nul
link /NOLOGO /INCREMENTAL:NO /MACHINE:X86 /subsystem:console
/out:"bin\msvc-9.0express\release\architecture-x86\link-static\runtime-link-static\threading-multi\server.exe"
/LIBPATH:"..\..\sdk\SQLite" /LIBPATH:"..\..\sdk\sqplus\lib"
/LIBPATH:"..\..\sdk\zlib123" /NODEFAULTLIB:msvcprtd.lib
/NODEFAULTLIB:msvcrt.lib /NODEFAULTLIB:msvcrtd.lib /SUBSYSTEM:CONSOLE
/VERBOSE:LIB
@"bin\msvc-9.0express\release\architecture-x86\link-static\runtime-link-static\threading-multi\server.exe.rsp"
        if %ERRORLEVEL% NEQ 0 EXIT %ERRORLEVEL%
    
...failed msvc.link
bin\msvc-9.0express\release\architecture-x86\link-static\runtime-link-static\threading-multi\server.exe...
...skipped <p..>server.exe for lack of
<pbin\msvc-9.0express\release\architecture-x86\link-static\runtime-link-static\threading-multi>server.exe...
...failed updating 1 target...
...skipped 1 target...

And here's my jamfile.jam:

project
    :
    requirements
        <include>../lib
        <include>/boost/boost_1_42_0/
    ;

lib winsock : : <name>ws2_32 ;
explicit winsock ;

exe server
    :
    [ glob *.cpp ]
    /boost/thread//boost_thread
    /boost/date_time//boost_date_time
    /boost/filesystem//boost_filesystem
    /lib
    winsock
    :
    <toolset>msvc:<cflags>/MTd
    <toolset>msvc:<linkflags>/VERBOSE:LIB
    <toolset>msvc:<linkflags>/SUBSYSTEM:CONSOLE
    <toolset>msvc:<linkflags>/NODEFAULTLIB:msvcrt.lib
    <toolset>msvc:<linkflags>/NODEFAULTLIB:msvcrtd.lib
    <toolset>msvc:<linkflags>/NODEFAULTLIB:msvcprtd.lib
    <target-os>windows:<define>WIN32
    <target-os>windows:<define>_MBCS
    <target-os>windows:<define>_CONSOLE
    <define>_DEBUG<variant>debug
    <define>NDEBUG<variant>release
    <define>SERVER
    <target-os>windows:<link>static
    <target-os>windows:<runtime-link>static
    <target-os>windows:<threading>multi
    <target-os>windows:<architecture>x86
    ;

install install-bin
    : server
    : <target-os>windows:<location>".."
      <target-os>linux:<location>/usr/local/bin
    ;

Thanks in advance for help.

-- 
View this message in context: http://old.nabble.com/building-release-attempts-to-link-against-debug-boost-libs-tp28646713p28646713.html
Sent from the Boost - Build mailing list archive at Nabble.com.

Boost-Build list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk