Sign in to follow this  

GUID problem

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

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this