Game Development Community

Compiler error while #including

by 4LIEN · in Torque Game Engine · 10/09/2006 (7:43 pm) · 1 replies

Hi,

I'm having some problems compiling Torque when I #include . I'm getting two different sets of errors, depending on whether I put the line before or after #include "platform/platform.h". I'm guessing the problem stems from the platform independent code, but that doesn't really help me resolve it.

I'm using Visual C++ 2005 Express on WinXP. This is in Torque 1.4.

For the record, the #include is needed for a debug logging library I'm trying to integrate. If anyone is aware of C++ logging functionality already provided by Torque, I'd love to hear about it. :)


Here's the dump if I #include before the platform #include:

winMemory.obj : error LNK2005: "void * __cdecl operator new(unsigned int,void *)" (??2@YAPAXIPAX@Z) already defined in camera.obj
../Game/Game_DEBUG.exe : fatal error LNK1169: one or more multiply defined symbols found



Here's the dump if I #include after the platform #include:

c:\program files\microsoft visual studio 8\vc\include\crtdbg.h(1118) : warning C4229: anachronism used : modifiers on data are ignored
c:\program files\microsoft visual studio 8\vc\include\crtdbg.h(1118) : error C2365: 'operator new' : redefinition; previous definition was 'function'
c:\program files\microsoft visual studio 8\vc\include\crtdbg.h(1118) : error C2078: too many initializers
c:\program files\microsoft visual studio 8\vc\include\crtdbg.h(1128) : error C2226: syntax error : unexpected type 'size_t'
c:\program files\microsoft visual studio 8\vc\include\xdebug(32) : warning C4229: anachronism used : modifiers on data are ignored
c:\program files\microsoft visual studio 8\vc\include\xdebug(32) : error C2078: too many initializers
c:\program files\microsoft visual studio 8\vc\include\xdebug(32) : error C2440: 'initializing' : cannot convert from 'int' to 'void *'
Conversion from integral type to pointer type requires reinterpret_cast, C-style cast or function-style cast
c:\program files\microsoft visual studio 8\vc\include\xlocale(138) : error C2059: syntax error : 'string'
c:\program files\microsoft visual studio 8\vc\include\xlocale(139) : error C2091: function returns function
c:\program files\microsoft visual studio 8\vc\include\xlocale(139) : error C2333: 'std::locale::facet::operator new' : error in function declaration; skipping function body
c:\program files\microsoft visual studio 8\vc\include\xlocale(144) : error C2059: syntax error : 'string'
c:\program files\microsoft visual studio 8\vc\include\xlocale(147) : error C2059: syntax error : 'return'
c:\program files\microsoft visual studio 8\vc\include\xlocale(147) : error C2238: unexpected token(s) preceding ';'
c:\program files\microsoft visual studio 8\vc\include\xlocale(150) : error C2628: 'std::locale::facet' followed by 'void' is illegal (did you forget a ';'?)
c:\program files\microsoft visual studio 8\vc\include\xlocale(152) : error C2817: return type for 'operator delete' must be 'void'




Thanks in advance for any help,

D.


#1
10/09/2006 (8:16 pm)
Hi 4LIEN,

There is a little bit of work that needs to be done to use the STL with Torque.

The following resource explains the issue and provides the work around:

www.garagegames.com/index.php?sec=mg&mod=resource&page=view&qid=7480


Todd