Skip to main content
GameDev.net gamedev.net
🔒 Locked

Help plz .... !

Started by logout Dec 10, 2002 at 2:39 PM 1 replies 700+ views
Original Post
logout
logout
I am creating a app with DPlay. But when i try to include a GUID i get all sorts of errors. Like in "main.h" i define : {code] GUID MYAPP_GUID = { 0x2ea835b, 0x9179, 0x485f, { 0x83, 0x43, 0x90, 0x1d, 0x32, 0x7f, 0xe7, 0x94 } }; And when i try to compile i get these errors :
-------------------Configuration: DP - Win32 Debug--------------------
Linking...
DPMessagePump.obj : error LNK2005: "struct _GUID MYAPP_GUID" (?MYAPP_GUID@@3U_GUID@@A) already defined in DPlay.obj
main.obj : error LNK2005: "struct _GUID MYAPP_GUID" (?MYAPP_GUID@@3U_GUID@@A) already defined in DPlay.obj
CButtonWnd.obj : error LNK2005: "struct _GUID MYAPP_GUID" (?MYAPP_GUID@@3U_GUID@@A) already defined in DPlay.obj
CEditWnd.obj : error LNK2005: "struct _GUID MYAPP_GUID" (?MYAPP_GUID@@3U_GUID@@A) already defined in DPlay.obj
CListBoxWnd.obj : error LNK2005: "struct _GUID MYAPP_GUID" (?MYAPP_GUID@@3U_GUID@@A) already defined in DPlay.obj
CStaticWnd.obj : error LNK2005: "struct _GUID MYAPP_GUID" (?MYAPP_GUID@@3U_GUID@@A) already defined in DPlay.obj
dxutil.obj : error LNK2001: unresolved external symbol __imp__timeGetTime@0
Debug/DP.exe : fatal error LNK1120: 1 unresolved externals
Error executing link.exe.

DP.exe - 8 error(s), 0 warning(s)
 
so how is the "correct" way of defining a GUID when i got more than 1 file that will use it ?
IFooBar
IFooBar
try changing the name of your structure cause from the looks of it, there''s already a stucture in DPlay.cpp with the name of the stuct you''re defining. and as for teh last linker error
this one "dxutil.obj : error LNK2001: unresolved external symbol __imp__timeGetTime@0"

add this to your code
#pragma comment(lib, "winmm.lib")
the winmm library contains the definition for the function timeGetTime() so you need to link it if you want to use timeGetTime()


:::Al:::
[Triple Buffer V2.0] - Resource leak imminent. Memory status: Fragile
[size=2]aliak.net
DrunkenHyena
DrunkenHyena


In your main.cpp:
GUID MYAPP_GUID = { 0x2ea835b, 0x9179, 0x485f, { 0x83, 0x43, 0x90, 0x1d, 0x32, 0x7f, 0xe7, 0x94 } };

In your main.h:
extern GUID MYAPP_GUID;
Stay Casual,KenDrunken Hyena</FON

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.