Boost logo

Boost Testing :

Subject: Re: [Boost-testing] Link boost library in Visual C++
From: Steven Watanabe (watanabesj_at_[hidden])
Date: 2012-07-31 20:37:55


AMDG

On 07/31/2012 08:57 AM, Suzanne Wood wrote:
> I'd first built boost by installing bjam, but was having trouble with
> naming conventions. Tried compiling with different options and ended
> up compiling boost again using the bootstrap and b2 tools in the
> distribution.
>

The correct forum for this is boost-users.

> These are the responses from visual studio 2010 (C++ express).
>
> error when attaching C:\Program
> Files\boost\boost_1_49_0\bin.v2\libs\test\build\msvc-10.0\debug\asynch-exceptions-on\threading-multi
> (built using bjam)
>
> 1>------ Build started: Project: common, Configuration: Debug Win32 ------
> 1>LINK : fatal error LNK1104: cannot open file
> 'libboost_unit_test_framework-vc100-mt-gd-1_49.lib'
> ========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========
>
>
> error with only c:\Program Files\boost\boost_1_49_0\stage\lib (built
> using bootstrap & b2)
>
> 1>------ Build started: Project: common, Configuration: Debug Win32 ------
> 1>LINK : fatal error LNK1104: cannot open file
> 'boost_unit_test_framework-vc100-mt-gd-1_49.lib'
> ========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========
>

You should only need .../stage/lib.
Also, you shouldn't need to link to both
libraries. Boost.Test uses auto linking
to find the correct library.

a) Do BOOST_TEST_DYN_LINK/BOOST_ALL_DYN_LINK have
   the same value in all translation units?
   Compiling with -DBOOST_LIB_DIAGNOSTIC will
   indicate which libraries you're linking to.
b) Are you explicitly linking to one of these
   libraries? If so, you can remove it.

>
> when both are in Linker->General->Additional Library Directories
>
> 1>------ Build started: Project: common, Configuration: Debug Win32 ------
> 1>boost_unit_test_framework-vc100-mt-gd-1_49.lib(boost_unit_test_framework-vc100-mt-gd-1_49.dll)
> : error LNK2005: "class boost::unit_test::master_test_suite_t &
> __cdecl
> boost::unit_test::framework::master_test_suite(void)"
> (?master_test_suite_at_framework@unit_test_at_boost@@YAAAVmaster_test_suite_t_at_23@XZ)
> already defined in libboost_unit_test_framework-vc100-mt-gd-1_49.lib
> (framework.obj)
> . . . etc.
>
> In Config->Linker->Command Line (for the b2 build)
> . . . /LIBPATH:"C:\...\zlib\contrib\vstudio\vc10\x86\ZlibDllDebug"
> /LIBPATH:"c:\Program Files\boost\boost_1_49_0\stage\lib"
> "kernel32.lib" "user32.lib" "gdi32.lib" "winspool.lib" "comdlg32.lib"
> "advapi32.lib" "shell32.lib" "ole32.lib" "oleaut32.lib" "uuid.lib"
> "odbc32.lib" "odbccp32.lib"
>
>
> How might I communicate to Visual C++ Express to be satisfied with one
> build of the boost libraries or the other? Thank you for any idea to
> proceed.
>

In Christ,
Steven Watanabe


Boost-testing list run by mbergal at meta-comm.com