Boost logo

Boost Users :

From: Daryle Walker (darylew_at_[hidden])
Date: 2008-09-01 15:16:25


On Aug 30, 2008, at 2:33 PM, Matthieu Brucher wrote:

> Meanwhile, I investigated the matter a little further. This symbole is
> defined in the Boost unit test framework library, so it should have
> been included in the object file. May it be a Visual Studio issue ?
> Was Boost 1.36 tested with Visual Studio 2008 SP1 ?
>
> On a side note, there is no multi-file Boost.Test example.

Look at my MD5 code in the sandbox SVN, <http://svn.boost.org/trac/
boost/browser/sandbox/md5/libs/coding/test>, for tests the span
multiple files. (The three MD5-related test files are supposed to be
compiled together. The Adler-32 test file is separate.)

> 2008/8/30 Matthieu Brucher <matthieu.brucher_at_[hidden]>:
>> Nobody has a clue on this matter ? Anyone uses Boost 1.36 with
>> multiple files with Visual Studio 2008 ?

>> 2008/8/28 Matthieu Brucher <matthieu.brucher_at_[hidden]>:
>>> I'm trying to build a test suite that worked with Linux and an older
>>> Boost version (1.34.1). I tried to compile it with Visual Studio
>>> 2008
>>> SP1 with Boost 1.36 and I ran into this error :
>>> link /nologo /OUT:IRT_test_suit.exe /LIBPATH:D:\Travail
>>> \boost_1_36_0\lib "/LIBPA
>>> TH:D:\Python 2.5\libs" /LIBPATH:. IRT.lib
>>> boost_unit_test_framework-vc90-mt-1_36
>>> .lib tools\boost_main_test.obj test_light.obj
>>> boost_unit_test_framework-vc90-mt-1_36.lib
>>> (boost_unit_test_framework-vc90-mt-1_3
>>> 6.dll) : error LNK2005: "public: static class
>>> boost::unit_test::unit_test_log_t
>>> & __cdecl boost::unit_test::singleton<class
>>> boost::unit_test::unit_test_log_t>::
>>> instance(void)" (?instance@?
>>> $singleton_at_Vunit_test_log_t_at_unit_test_at_boost@@@unit_t
>>> est_at_boost@@SAAAVunit_test_log_t_at_23@XZ) déjà défini(e) dans
>>> test_light.obj
>>> IRT_test_suit.exe : fatal error LNK1169: un ou plusieurs symboles
>>> définis à diff
>>> érentes reprises ont été rencontrés
>>>
>>> boost_main_test.cpp consists of:
>>> #define BOOST_TEST_DYN_LINK
>>> #define BOOST_TEST_MODULE "IRT test suit"
>>> #include <boost/test/unit_test.hpp>
>>>
>>> And test_light.cpp:
>>> #include <boost/test/unit_test.hpp>
>>>
>>> Both files were compiled with the arguments cl /nologo /EHsc /Ox /MD
>>> -D_CRT_SECURE_NO_DEPRECATE -DWIN32 /TP /ID:\Travail\boo
>>> st_1_36_0 /I. /c test_light.cpp /Fotest_light.obj
>>>
>>> I didn't find a thing on the Internet with this issue, so I hope
>>> someone will have a clue...

Did you make sure that the BOOST_TEST_DYN_LINK and BOOST_TEST_MODULE
macros are the current names? All sorts of names within Boost.Test
have changed over the years, so make sure you're up to date when
upgrading your Boost setup. Also, the list of mandatory source files
has changed over the years, so make sure your upgraded project file
isn't missing a source file that was added since boost 1.34.1. (Look
in "BOOST_ROOT/libs/test/src" for the files, and "BOOST_ROOT/libs/
test/build/Jamfile.v2" to see the lists of which sub-libraries use
which source files. You need to look at the unit-test sub-library's
list.)

-- 
Daryle Walker
Mac, Internet, and Video Game Junkie
darylew AT hotmail DOT com

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