Thread: Compiler errors

  1. #1
    Darkness Prevails Dark_Phoenix's Avatar
    Join Date
    Oct 2006
    Location
    Houston, Texas
    Posts
    174

    Compiler errors

    OK, I have been learning DirectX for a while now and everything has been going (mostly) great. I am about throught with the graphics part and moving on to DirectInput. The first example that I did is throwing these errors at me.
    Code:
    Warning: .drectve `/DEFAULTLIB:"uuid.lib" /DEFAULTLIB:"uuid.lib" ' unrecognized
    Warning: .drectve `/DEFAULTLIB:"uuid.lib" /DEFAULTLIB:"uuid.lib" ' unrecognized
    cFramework.o(.text+0x6b9):cFramework.cpp: undefined reference to `IID_IDirectInput8A'
    cInput.o(.text+0x219):cInput.cpp: undefined reference to `GUID_SysKeyboard'
    cInput.o(.text+0x2bb):cInput.cpp: undefined reference to `GUID_SysMouse'
    C:/Dev-Cpp/lib/libdinput8.a(dilib2.obj)(.text+0x0):..\dilib2.c: undefined reference to `GUID_Key'
    C:/Dev-Cpp/lib/libdinput8.a(dilib2.obj)(.text+0x10):..\dilib2.c: undefined reference to `GUID_Key'
    C:/Dev-Cpp/lib/libdinput8.a(dilib2.obj)(.text+0x20):..\dilib2.c: undefined reference to `GUID_Key'
    C:/Dev-Cpp/lib/libdinput8.a(dilib2.obj)(.text+0x30):..\dilib2.c: undefined reference to `GUID_Key'
    C:/Dev-Cpp/lib/libdinput8.a(dilib2.obj)(.text+0x40):..\dilib2.c: undefined reference to `GUID_Key'
    C:/Dev-Cpp/lib/libdinput8.a(dilib2.obj)(.text+0x50):..\dilib2.c: more undefined references to `GUID_Key' follow
    C:/Dev-Cpp/lib/libdinput8.a(dilib1.obj)(.text+0x0):..\dilib1.c: undefined reference to `GUID_XAxis'
    C:/Dev-Cpp/lib/libdinput8.a(dilib1.obj)(.text+0x10):..\dilib1.c: undefined reference to `GUID_YAxis'
    C:/Dev-Cpp/lib/libdinput8.a(dilib1.obj)(.text+0x20):..\dilib1.c: undefined reference to `GUID_ZAxis'
    Now, and correct me if I am wrong, it looks to me that it is trying to include 'uuid.lib' twice, but I cannot find where it is doing this, much less how to correct it.

    I have read various texts that state you must
    Code:
    #define INITGUID
    so that you can use GUID_SysKeyboard / GUID_SysMouse and
    Code:
    #define DIRECTINPUT_VERSION 0x0800
    but these do not seem to make any difference

    I am thinking that all the other errors on the list originate from the first two lines but I am at a lost as to how to resolve it.

    This is what my main header looks like
    Code:
    #ifndef STDHEADER_H
    #define STDHEADER_H
    
    #define INITGUID
    #define DIRECTINPUT_VERSION 0x0800
    #define WIN32_LEAN_AND_MEAN
    
    // Incudes
    #include <windows.h>
    #include <ctime>
    #include <cstdio>
    
    // DirectX includes
    #include <d3d9.h>
    #include <d3dx9.h>
    #include <dinput.h>
    
    // other includes
    #include "cFramework.h"
    #include "cGraphics.h"
    #include "cGameApp.h"
    #include "CVertexBuffer.h"
    #include "CIndexBuffer.h"
    #include "CWorldTransform.h"
    #include "CUtility.h"
    #include "cTimer.h"
    #include "cFont.h"
    #include "cInput.h"
    
    //  Macros
    #define KEYDOWN(vk_code)     ( (GetAsyncKeyState(vk_code) & 0x8000) ? 1 : 0)
    #define KEYUP(vk_code)       ( (GetAsyncKeyState(vk_code) & 0x8000) ? 0 : 1)
    #define SAFE_DELETE(X)       { X = NULL; delete X; }
    #define SAFE_DELETE_ARRAY(X) if(X) { delete [] (X); (X) = NULL; }
    #define SAFE_RELEASE(X)      if(X) { (X)->Release(); (X) = NULL;  }
    #define SHOWERROR(s,f,l)     char ErrBuf[1024]; \
                                 sprintf(ErrBuf, "File: %s\nLine: %d\n%s",f,l,s); \
                                 MessageBox(0, ErrBuf, "Error", 0);
    
    #endif
    and the only linker options i have are
    Code:
    -ldinput8 -ld3d9 -ld3dx9
    Thanx for any help

    I am using Dev-C++, Windows XP
    Last edited by Dark_Phoenix; 11-04-2006 at 07:49 PM.

  2. #2
    Registered User VirtualAce's Avatar
    Join Date
    Aug 2001
    Posts
    9,607
    You must link with dxguid.lib to link in the GUIDs.

  3. #3
    Darkness Prevails Dark_Phoenix's Avatar
    Join Date
    Oct 2006
    Location
    Houston, Texas
    Posts
    174
    OK, I missed that part in my book. It said the #include INITGUID OR link th dxguid.lib... missed the or part :P

    Its working now, thanx Bubba!
    Using Code::Blocks and Windows XP

    In every hero, there COULD be a villain!

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Problem building Quake source
    By Silvercord in forum Game Programming
    Replies: 16
    Last Post: 07-11-2010, 09:13 AM
  2. Ten Errors
    By AverageSoftware in forum Contests Board
    Replies: 0
    Last Post: 07-20-2007, 10:50 AM
  3. bloodshed compiler errors
    By nerore in forum C++ Programming
    Replies: 5
    Last Post: 04-17-2004, 02:37 PM
  4. How to resolve linking errors?
    By m712 in forum C++ Programming
    Replies: 3
    Last Post: 11-03-2002, 10:17 PM
  5. Compiler errors
    By BellosX in forum C Programming
    Replies: 2
    Last Post: 09-21-2001, 03:24 AM