Jump to content

  • Log In with Google      Sign In   
  • Create Account

Interested in a FREE copy of HTML5 game maker Construct 2?

We'll be giving away three Personal Edition licences in next Tuesday's GDNet Direct email newsletter!

Sign up from the right-hand sidebar on our homepage and read Tuesday's newsletter for details!


DirectInput Linker errors.


Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

  • You cannot reply to this topic
9 replies to this topic

#1 bosjoh   Members   -  Reputation: 122

Like
Likes
Like

Posted 11 October 1999 - 06:40 PM

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);
};


Sponsor:

#2 pdown   Members   -  Reputation: 122

Like
Likes
Like

Posted 08 October 1999 - 08:37 AM

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).]


#3 bosjoh   Members   -  Reputation: 122

Like
Likes
Like

Posted 08 October 1999 - 08:34 PM

Yes, I did.
The compiler only moans about UID_SysKeyboard and GUID_SysKey.

#4 felisandria   Members   -  Reputation: 739

Like
Likes
Like

Posted 08 October 1999 - 09:05 PM

To use GUID, you also need to include
dxguid.lib
and you need to
#define INITGUID

g'luck
-fel


#5 bosjoh   Members   -  Reputation: 122

Like
Likes
Like

Posted 09 October 1999 - 07:13 AM

It works!
thanx.

#6 Sixpack   Members   -  Reputation: 122

Like
Likes
Like

Posted 10 October 1999 - 02:56 PM

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


#7 bosjoh   Members   -  Reputation: 122

Like
Likes
Like

Posted 10 October 1999 - 07:33 PM

Nope, using VC++ 6.0 libs.
Is this upgrade also available for VC++ 6.0?
I hope it isn't 128 MB (!)

#8 Sixpack   Members   -  Reputation: 122

Like
Likes
Like

Posted 11 October 1999 - 11:31 AM

bosjoh,
When I said DX7 gold, I meant the RTM. If you have the final version, you should be fine.

Six


#9 todderod   Members   -  Reputation: 152

Like
Likes
Like

Posted 11 October 1999 - 12:45 PM

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


#10 bosjoh   Members   -  Reputation: 122

Like
Likes
Like

Posted 11 October 1999 - 06:40 PM

I'll try it.




Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.



PARTNERS