Jump to content
  • Advertisement
Sign in to follow this  
moucard

linker error when adding a direct play class

This topic is 5099 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hello again to everyone. I've (hopefully) succesfully compiled my project adding a new CNet class which tries to encapsulate DirectPlay for some simple peer 2 peer communication, with one app acting as host and the other as client. The CNet is a patchwork of the examples from the directx 9.0 sdk. Not a beautifull site, and not very informative (the documentation). A diagram would help a lot. Anyway, the problem is when I try to #include the file "CNet.h" in another class to use it. I get linker errors like this:
main.obj : error LNK2005: _CLSID_DP8SP_BLUETOOTH already defined in CNet.obj
main.obj : error LNK2005: _CLSID_DP8SP_TCPIP already defined in CNet.obj
main.obj : error LNK2005: _CLSID_DP8SP_SERIAL already defined in CNet.obj
Reading the documentation, it says that the most common cause is linking with both the single and multi threaded libraries. Which libraries are these? If anyone has any previous experience please help! Thank you for your time.

Share this post


Link to post
Share on other sites
Advertisement
Ok, I've removed the #define INITGUID directive and linked directly with dxguid.lib. This removed almost all linker errors exept this one:

Trace.obj : error LNK2005: "struct _GUID GUID_CoucouCacheGame" (?GUID_CoucouCacheGame@@3U_GUID@@A) already defined in CGame.obj
Main.obj : error LNK2005: "struct _GUID GUID_CoucouCacheGame" (?GUID_CoucouCacheGame@@3U_GUID@@A) already defined in CGame.obj
CNet.obj : error LNK2005: "struct _GUID GUID_CoucouCacheGame" (?GUID_CoucouCacheGame@@3U_GUID@@A) already defined in CGame.obj
Debug/Game.exe : fatal error LNK1169: one or more multiply defined symbols found

The GUID_CoucouCacheGame is a global variable defined in the CNet.h file like this:

GUID GUID_CoucouCacheGame = {0x6b455f69, 0xd93e, 0x4484, {0x91, 0xc1, 0x84, 0x97, 0x20, 0x7f, 0x0, 0x25}};

Anyone having any ideas?
PS: The three .obj files that seem to produce the error are the one that the variable propagates. Main.obj includes Game.h, Game.h includes Trace.h, Trace includes CNet.h Interesting though that I don't get a linker error for CGame.obj

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!