DX7 - Linker - multiply defined symbols

Started by
4 comments, last by Crow-knee 22 years, 4 months ago
Two lines have been the bane of my existence for the last week or so - both cheerfully given by the linker... quinkin.obj : error LNK2005: "struct _GUID d3dgid" (?d3dgid@@3U_GUID@@A) already defined in 3dapp.obj Debug/Quinkin.exe : fatal error LNK1169: one or more multiply defined symbols found d3dgid is defined as such : GUID d3dgid; If I comment out all uses of the variable except the declaration, the errors persist. The header file declarations, where the above line resides, is safely encapsulated by #ifndef ... #endif. I have tried re-installing the SDK, trying static declarations... but nothing seems to make a difference. Am I not looking in the right place? Any help would be greatly appreciated as I attempt to make the transition from 2D to 3D. Thanks. Steele.
Advertisement
maybe you have to include the file dxguid.lib into the list of
Object/Library modules of the Project settings.

Project---->Settings---->Link (and there you can include dxguid.lib into the modules line).


or put
#include

neil
WHATCHA GONNA DO WHEN THE LARGEST ARMS IN THE WORLD RUN WILD ON YOU?!?!
sorry this thing just messed up the code

#include initguid.h

with greater than and less than at either side

Not sure on HTML only C++
sorry

Neil
WHATCHA GONNA DO WHEN THE LARGEST ARMS IN THE WORLD RUN WILD ON YOU?!?!
In the .h file you should use:
extern GUID d3dgid; 

And in ONE .cpp file you need to define it w/o the extern:
GUID d3dgid; 
Thanks guys! It seemed to be a bit of all of them! With a bit of shuffling about with includes, an extern declaration and rebuild, I have it working.
Ta for the help.
Steele.
Woooohoooooooooo!!!

This topic is closed to new replies.

Advertisement