Advertisement

DirectInput Linker errors.

Started by October 12, 1999 12:40 AM
8 comments, last by bosjoh 25 years, 2 months ago
This may be a silly answer, but did you try linking with dinput.lib?

[This message has been edited by pdown (edited October 08, 1999).]

Yes, I did.
The compiler only moans about UID_SysKeyboard and GUID_SysKey.
Advertisement
To use GUID, you also need to include
dxguid.lib
and you need to
#define INITGUID

g'luck
-fel

~ The opinions stated by this individual are the opinions of this individual and not the opinions of her company, any organization she might be part of, her parrot, or anyone else. ~
It works!
thanx.
bosjoh,
Are you perhaps using the DX7 borland libs? I know that during the beta, the lib's had an error in them. They should be fine now. Did you upgrade to DX7 gold?

Six

Nope, using VC++ 6.0 libs.
Is this upgrade also available for VC++ 6.0?
I hope it isn't 128 MB (!)
Advertisement
bosjoh,
When I said DX7 gold, I meant the RTM. If you have the final version, you should be fine.

Six

You do not need to include the dxguid.lib
AND #define INITGUID as stated above. Just #define INITGUID would do in most cases. Adding the lib would only increase the size of your exe-file. Try without the lib, if it works then, do not use it.

Christoffer Sandberg
todderod@algonet.se

I'm trying to create a directinput object and then creating a keyboard object. All fine, but the linker is giving 'unresolved reference' errors. I've included some code:

bool DirectInputInit(){
HRESULT dirval;
dirval = DirectInputCreate((HINSTANCE)GetWindowLong(windowhandle,GWL_HINSTANCE), DIRECTINPUT_VERSION, &lpDI, NULL);
if( dirval != DI_OK) return(false);
dirval = lpDI->CreateDevice(GUID_SysKeyboard,&lpKeyboard,NULL);
if( dirval != DI_OK) return(false);
dirval = lpKeyboard->SetDataFormat(&c_dfDIKeyboard);
if( dirval != DI_OK) return(false);
dirval = lpKeyboard->SetCooperativeLevel(windowhandle,DISCL_EXCLUSIVE | DISCL_FOREGROUND);
if( dirval != DI_OK) return(false);
lpKeyboard->Acquire();
return(true);
};

I'll try it.

This topic is closed to new replies.

Advertisement