Help! I can't figure out this linking error
by Eric Fleming · in Torque Game Engine Advanced · 09/07/2006 (3:52 pm) · 2 replies
My code will not link. I'm getting the following error:
error LNK2005: "void * __cdecl operator new(unsigned int,void *)" (??2@YAPAXIPAX@Z) already defined in winMemory.obj
This error is happening in most but not all of my cpp files. Weirdly, some of the files where the error occurs have no new operators, while others with plenty of new operators don't have it. I'm not doing anything special with the new operator, so I can't figure out why this would be happening. I read on the internet that this error sometimes happens when certain libraries are loaded in the wrong order, but I would think you would have seen that problem already if that were the case.
Has anyone run into this issue when adding new code to the engine?
error LNK2005: "void * __cdecl operator new(unsigned int,void *)" (??2@YAPAXIPAX@Z) already defined in winMemory.obj
This error is happening in most but not all of my cpp files. Weirdly, some of the files where the error occurs have no new operators, while others with plenty of new operators don't have it. I'm not doing anything special with the new operator, so I can't figure out why this would be happening. I read on the internet that this error sometimes happens when certain libraries are loaded in the wrong order, but I would think you would have seen that problem already if that were the case.
Has anyone run into this issue when adding new code to the engine?
About the author
#2
We don't seem to have it buried anywhere...
09/08/2006 (1:26 am)
This is the standard "Torque doesn't play well with STL" issue I'm thinking. After doing a quick search for the resource that discusses it however, I found that the link doesn't work properly--does anyone happen to have a valid link to stl_fix.h (or possibly the file itself?).We don't seem to have it buried anywhere...
Torque 3D Owner Brandon Maness