|
Boost Users : |
From: Wu Yinghui, Freddie (yhwu_at_[hidden])
Date: 2005-11-23 05:59:31
Dear all,
I'm having a problem linking the simplest Boost unit_test program on the
platform described above. More details here:
Compiler: MSVC71
OS: WinXP Pro SP2
STLport 5.0 config: All default as obtained from CVS STLPORT_5_0 branch,
except that I use /Zc:wchar_t to use wchar_t as built-in type.
Boost 1.33/34: All default as obtained from CVS, built with the
following command line:
bjam --without-python "-sBUILD=debug release <runtime-link>static
<threading>multi <stlport-version>5.0 <native-wchar_t>on
<define>BOOST_SIGNALS_NAMESPACE=siglib" stage
My simple unit_test program:
=====
#include <string>
#define BOOST_AUTO_TEST_MAIN
#include <boost/test/auto_unit_test.hpp>
BOOST_AUTO_UNIT_TEST( Test_Function )
{
std::wstring string = L"some test string";
BOOST_CHECK( string.length() == 16 );
}
=====
My project setting uses "Multi-threaded DLL (/MD)" in code gen, and
links to "libboost_unit_test_framework-vc71-mt-sgdp.lib" in debug mode.
My purpose was to use STLport in a DLL, but the whole Boost statically
linked. (I know I can link with
"libboost_unit_test_framework-vc71-mt-gdp.lib," but I want Boost to be
statically linked.)
The linker gives the following errors:
stlportstld.5.0.lib(stlportstld.5.0.dll) : error LNK2005: "public:
__thiscall stlpd_std::__owned_list::~__owned_list(void)"
(??1__owned_list_at_stlpd_std@@QAE_at_XZ) already defined in
libboost_unit_test_framework-vc71-mt-sgdp.lib(unit_test_suite.obj)
stlportstld.5.0.lib(stlportstld.5.0.dll) : error LNK2005: "public:
__thiscall stlpd_std::basic_string<char,class
stlpd_std::char_traits<char>,class stlpd_std::allocator<char>
>::~basic_string<char,class stlpd_std::char_traits<char>,class
stlpd_std::allocator<char> >(void)"
(??1?$basic_string_at_DV?$char_traits_at_D@stlpd_std@@V?$allocator_at_D@2@@stlpd_std@@QAE_at_XZ)
already defined in
libboost_unit_test_framework-vc71-mt-sgdp.lib(unit_test_suite.obj)
stlportstld.5.0.lib(stlportstld.5.0.dll) : error LNK2005: "public:
static void __cdecl stlpd_std::__node_alloc<1,0>::deallocate(void
*,unsigned int)"
(?deallocate@?$__node_alloc@$00$0A@@stlpd_std@@SAXPAXI_at_Z) already
defined in
libboost_unit_test_framework-vc71-mt-sgdp.lib(unit_test_suite.obj)
stlportstld.5.0.lib(stlportstld.5.0.dll) : error LNK2005: "public: class
stlpd_std::basic_string<char,class stlpd_std::char_traits<char>,class
stlpd_std::allocator<char> > & __thiscall
stlpd_std::basic_string<char,class stlpd_std::char_traits<char>,class
stlpd_std::allocator<char> >::assign(char const *,unsigned int)"
(?assign@?$basic_string_at_DV?$char_traits_at_D@stlpd_std@@V?$allocator_at_D@2@@stlpd_std@@QAEAAV12_at_PBDI@Z)
already defined in
libboost_unit_test_framework-vc71-mt-sgdp.lib(unit_test_log.obj)
<more similar errors removed...>
Is there any kind soul here can enlighten me a bit? Is it at all
recommended (or even possible) to use STLport in DLL while statically
linking with Boost?
Cheers,
Freddie
-- Wu Yinghui, Freddie Research & Development Software Engineer Volume Interactions Pte Ltd 1 Kim Seng Promenade, #12-01 Great World City East Tower Singapore 237994 Tel: +65 62226962 (Ext 216) Fax: +65 62226215 Email: yhwu_at_[hidden] URL: http://www.volumeinteractions.com Important: This message is intended for the recipient(s) addressed above. It contains privileged and confidential information. If you are not the intended recipient, please notify the sender immediately by replying to this message and then delete it from your system. You must not read, copy, use, or disseminate this communication in any form. Thank you.
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