Thread: Help with DirectInput

  1. #1
    Registered User
    Join Date
    Sep 2005
    Posts
    5

    Question Help with DirectInput

    I am attempting to program a joystick enumalator with DirectInput.
    I got it to where my code finally appears to work, but now I get some linker errors.
    Code:
     [Linker error] undefined reference to `IID_IDirectInput8A' 
     [Linker error] undefined reference to `DirectInput8Create@20' 
     [Linker error] undefined reference to `GUID_XAxis' 
     [Linker error] undefined reference to `GUID_YAxis'
    ...and so on.
    I have linked dinput.lib,dinput8.lib, all the ones I can find.
    And when I link dxguid.lib, some of them vanish, but I get another error:
    Code:
      .drectve `/DEFAULTLIB:"uuid.lib" /DEFAULTLIB:"uuid.lib" 'unrecognized
    Am I not linking something? Bad Code, perhaps?
    Can anyone help?
    Thanks,
    The_Goat();

  2. #2
    Registered User VirtualAce's Avatar
    Join Date
    Aug 2001
    Posts
    9,607
    Make sure you define what version of DirectInput you want BEFORE you include it's header.
    I have no idea why they designed it this way, but if you don't do this, it won't work.

  3. #3
    Registered User
    Join Date
    Sep 2005
    Posts
    5
    Thanks, but... it doesn't really change anything.

    I put:
    Code:
    #define DIRECTINPUT_VERSION 0x0800
    #include <dinput.h>
    #include <dinputd.h>
    EDIT:
    Never mind, I just needed different versions of the libraries then I had-
    works OK now.

    -The_Goat();
    Last edited by The_Goat(); 02-21-2006 at 06:40 PM.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. DirectInput
    By Lionmane in forum Windows Programming
    Replies: 4
    Last Post: 11-12-2005, 11:43 PM
  2. DirectInput and Dev-C++
    By Niara in forum Game Programming
    Replies: 2
    Last Post: 03-11-2005, 10:20 AM
  3. DirectInput woes again....
    By VirtualAce in forum Game Programming
    Replies: 4
    Last Post: 05-25-2004, 03:02 PM
  4. DirectInput or WM_KEYDOWN question
    By Mecnels in forum Game Programming
    Replies: 4
    Last Post: 03-18-2003, 06:45 AM
  5. My DirectInput tutorial....
    By jdinger in forum A Brief History of Cprogramming.com
    Replies: 1
    Last Post: 06-18-2002, 11:32 PM