Sign in to follow this  
ArgusMaker

[DX9 C++] Direct Input

Recommended Posts

ArgusMaker    102
Hi there!
I have a problem with DirectInput8Create, my compiler does not recognize it as a defined function, but i included dinput.h...
What should i do? ;)

Share this post


Link to post
Share on other sites
Texus    248
Don't you also need to include the "dinput8.lib"?

You can do this with the following line:
[code]
#pragma comment (lib, "dinput8.lib")
[/code]

EDIT: Sorry, I thought this was necessary, but I just tested it and it seems it isn't.

Share this post


Link to post
Share on other sites
lonewolff    1183
This is what I have at the start of my Direct Input class and the function calls work ok for me.

Hope this helps.

[code]#pragma once
#define DIRECTINPUT_VERSION 0x0800

#include<Windows.h>
#include<dinput.h>

#pragma comment(lib,"dinput8.lib")
#pragma comment(lib,"dxguid.lib")[/code]

[EDIT] The SDK version shouldn't matter too much. Some of my projects use 'DX Summer 2003 SDK' and others use the latest DX SDK. Both work fine for me. ;)

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