[Bf-committers] CVS Compilation under VS.net 2003
Fri, 23 Apr 2004 22:19:14 -0400
The problem occurs with the lines that reference std::cout.
libcpmtd.lib(xmutex.obj) : error LNK2005: "public: void __thiscall
std::_Mutex::_Lock(void)" (?_Lock@_Mutex@std@@QAEXXZ) already defined in
I figured out a fix for this without commenting out the source:
If you right click on the file SM_Object.cpp and go to properties. Under
C/C++ -> Code Generation -> Runtime Library. Select Multithreaded (/MT)
instead of single threaded.
[mailto:firstname.lastname@example.org]On Behalf Of Nathan Letwory
Sent: Friday, April 23, 2004 3:54 AM
Subject: Re: [Bf-committers] CVS Compilation under VS.net 2003
Interesting that with the same compiler, but compiled from SCons there
is no problem with Mutex::Lock. AFAICS there is the same libraries in-
and excluded as with the project files.
Nicolas Cannasse wrote:
>>Which C++ library? STL is already included and the game engine makes
>>extensive use of it.
>>On Friday 23 April 2004 01:32, Nicolas Cannasse wrote:
>>>There is several std:: calls that can easily be replaced (two std::swap
>>>one std::copy). They are forcing the include of some C++ library that is
>>>not compatible with the one used by other projects and araise conflicts
>>>when linking. In general, avoiding std:: calls is good porting practice
>>>since the MS STL is not really compliant.
> I'm not really sure since I'm not expert in C++ libs tricks.
> The only things I can tell :
> - when I linked, there was a conflict about Mutex::Lock between an MS lib
> (libcmtd.lib or something like that) and PHY_Sumo/SM_Object.cpp
> - I looked at the sources and there was no Mutex::Lock so I assumed there
> were imported as the same time as std:: namespace
> - I replaced the 3 calls to std:: by C ANSI calls ( one memcpy and 2
> pointer swaps ) and it worked.
> Nicolas Cannasse
Bf-committers mailing list