|
Boost : |
From: vc (vcotirlea_at_[hidden])
Date: 2003-04-14 13:34:08
Problems with filesystem and msvc 6.0The problem is that you are using diff runtime libraries.
You have to use the same flag for runtime libs ("Runtime Library") for your application
like the one used when building the boost lib.
What you can do is: when building the boost lib, use bjam -d2 so in this way
you can see the cl (compiler's) params. For the runtime lib it should be
(for debug) either /MTd or /MDd.
When you build your app (.exe) you have to make the same setting,
so either /MTd, or /MDd depends on what you see that the boost lib is using.
Note: for release version it is the same, but the flags are named /MT and /MD
Look in MSDNL to understand why you get this problem if you mix the flags.
Hope this helps,
Viv
----- Original Message -----
From: Kristian Lippert
To: 'boost_at_[hidden]'
Sent: Sunday, April 13, 2003 11:27 PM
Subject: [boost] Problems with filesystem and msvc 6.0
Hi
I have a problem with the boost::filesystem library and MSVC 6.0. I have build the lib-file for the filesystem library using bjam. I have created a simple console application and snapped the code from http://www.boost.org/libs/filesystem/example/simple_ls.cpp.
I have set a path for the lib-file and named it with the libboost_filesystem.lib in the Object/Library Module.
The program compiles without problems but the linking fails.
I hope that someone can help me?
Best regards,
Kristian Lippert
The errors look like:
--------------------Configuration: boostPathtester - Win32 Debug--------------------
Linking...
msvcprtd.lib(MSVCP60D.dll) : error LNK2005: "public: class std::basic_string<char,struct std::char_traitschar>,class std::allocator<char> > & __thiscall std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >::operator+=(char)" (??Y?$basic_string_at_DU?$char_traits_at_D@std@@V?$allocator_at_D@2@@std@@QAEAAV01_at_D@Z) already defined in libcpmtd.lib(locale.obj)
msvcprtd.lib(MSVCP60D.dll) : error LNK2005: "public: unsigned int __thiscall std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >::size(void)const " (?size@?$basic_string_at_DU?$char_traits_at_D@std@@V?$allocator_at_D@2@@std@@QBEIXZ) already defined in boostPathtester.obj
msvcprtd.lib(MSVCP60D.dll) : error LNK2005: "public: class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > & __thiscall std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >::operator=(char const *)" (??4?$basic_string_at_DU?$char_traits_at_D@std@@V?$allocator_at_D@2@@std@@QAEAAV01_at_PBD@Z) already defined in boostPathtester.obj
msvcprtd.lib(MSVCP60D.dll) : error LNK2005: "public: __thiscall std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >::basic_stringchar,struct std::char_traits<char>,class std::allocator<char> >(char const *,unsigned int,class basic_string<char,struct std::char_traits<char>,class std::allocator<char> >::allocator<char> const &)" (??0?$basic_string_at_DU?$char_traits_at_D@std@@V?$allocator_at_D@2@@std@@QAE_at_PBDIABV?$allocator_at_D@1@@Z) already defined in libcpmtd.lib(xlocale.obj)
.....
LINK : warning LNK4098: defaultlib "MSVCRTD" conflicts with use of other libs; use /NODEFAULTLIB:library
Debug/boostPathtester.exe : fatal error LNK1169: one or more multiply defined symbols found
Error executing link.exe.
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk