Jump to content
  • Advertisement
Sign in to follow this  

GUID problem

This topic is 4444 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

I am trying to put the guid define in a shared header along with other program variable defintions. But i get this error error LNK2001: unresolved external symbol _g_guidApp this is the code i am using:- #pragma once #define INITGUID // {8FDDD389-5A0F-4465-AFCF-B400A1CB2E05} DEFINE_GUID(g_guidApp, 0x8fddd389, 0x5a0f, 0x4465, 0xaf, 0xcf, 0xb4, 0x0, 0xa1, 0xcb, 0x2e, 0x5); #define DEFAULT_SESSION_NAME TEXT("Session 1") const DWORD CLIENTSERVER_PORT = 2699; I am linking to dxguid.lib the problem is when i try to include this header in more than one source file.

Share this post

Link to post
Share on other sites
According to this, guiddef.h File Reference the DEFINE_GUID macro is as follows:

#define DEFINE_GUID ( name,
b8 ) EXTERN_C const GUID FAR name

That's from the rotor pal docs, so it might not hold for all headers (even though it seems that it should). It would seem that when including the header in multiple files leads to declaring the variable multiple times which in conjunction with the 'extern' keyword raises the linker error. I'm not sure how to resolve the problem.

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!