SetDataFormat and c_dfDIJoystick2
hi all~
i'm consulting DirectInput to build a demo program which we can use joystick. but unluckily when i met c_dfDIJoystick2 which make compiler report a few errors. i searched the dinput.h and found it is an extern const and nothing more. anyone could figure it out pls ? tks.
my code :
g_lpJoystick1->SetDataFormat( &c_dfDIJoystick2 );
errors:
dinput.lib(dilib4.obj) : error LNK2001: unresolved external symbol _GUID_POV
dinput.lib(dilib4.obj) : error LNK2001: unresolved external symbol _GUID_Slider
dinput.lib(dilib4.obj) : error LNK2001: unresolved external symbol _GUID_RzAxis
dinput.lib(dilib4.obj) : error LNK2001: unresolved external symbol _GUID_RyAxis
dinput.lib(dilib4.obj) : error LNK2001: unresolved external symbol _GUID_RxAxis
dinput.lib(dilib4.obj) : error LNK2001: unresolved external symbol _GUID_ZAxis
dinput.lib(dilib4.obj) : error LNK2001: unresolved external symbol _GUID_YAxis
dinput.lib(dilib4.obj) : error LNK2001: unresolved external symbol _GUID_XAxis
Debug/Project1.exe : fatal error LNK1120: 8 unresolved externals
Error executing link.exe.
Project1.exe - 9 error(s), 0 warning(s)
Quoting from the DirectX SDK's FAQ:
"I get linker errors about multiple or missing symbols for globally unique identifiers (GUIDs), what do I do?
The various GUIDs you use should be defined once and only once. The definition for the GUID will be inserted if you #define the INITGUID symbol before including the DirectX header files. Therefore, you should make sure that this only occurs for one compilation unit. An alternative to this method is to link with the dxguid.lib library, which contains definitions for all of the DirectX GUIDs. If you use this method (which is recommended), then you should never #define the INITGUID symbol."
"I get linker errors about multiple or missing symbols for globally unique identifiers (GUIDs), what do I do?
The various GUIDs you use should be defined once and only once. The definition for the GUID will be inserted if you #define the INITGUID symbol before including the DirectX header files. Therefore, you should make sure that this only occurs for one compilation unit. An alternative to this method is to link with the dxguid.lib library, which contains definitions for all of the DirectX GUIDs. If you use this method (which is recommended), then you should never #define the INITGUID symbol."
Quote:Original post by Nik02
Quoting from the DirectX SDK's FAQ:
"I get linker errors about multiple or missing symbols for globally unique identifiers (GUIDs), what do I do?
The various GUIDs you use should be defined once and only once. The definition for the GUID will be inserted if you #define the INITGUID symbol before including the DirectX header files. Therefore, you should make sure that this only occurs for one compilation unit..."
how to define INITGUID symbol pls ?
Quote:Original post by blackgameQuote:Original post by Nik02
Quoting from the DirectX SDK's FAQ:
"I get linker errors about multiple or missing symbols for globally unique identifiers (GUIDs), what do I do?
The various GUIDs you use should be defined once and only once. The definition for the GUID will be inserted if you #define the INITGUID symbol before including the DirectX header files. Therefore, you should make sure that this only occurs for one compilation unit..."
how to define INITGUID symbol pls ?
#define INITGUID
Although it is reccomended you just link to dxguid.lib.
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement