Thread: Error with DirectX

  1. #1
    Computer guy
    Join Date
    Sep 2005
    Location
    I'm lost!!!
    Posts
    200

    Error with DirectX

    So, i see how short the code used in directx to create a simple window was and decide to run it. I have everything included, lib.. and... this is what i get:
    Code:
    CreateDevice.obj : error LNK2019: unresolved external symbol _Direct3DCreate9@4 referenced in function "long __cdecl InitD3D(struct HWND__ *)" (?InitD3D@@YAJPAUHWND__@@@Z)
    Debug/CreateDevice.exe : fatal error LNK1120: 1 unresolved externals
    This is the sample i got from the directX SDK, and i run it in Visual C++ 2005. Anyone has any idea?
    Hello, testing testing. Everthing is running perfectly...for now

  2. #2
    Registered User VirtualAce's Avatar
    Join Date
    Aug 2001
    Posts
    9,607
    Link with d3dx9.lib

  3. #3
    Computer guy
    Join Date
    Sep 2005
    Location
    I'm lost!!!
    Posts
    200
    I did, in the include lib directory, as well as using #pragma comment(lib, "d3dx9.lib") but it still give me the same error
    Hello, testing testing. Everthing is running perfectly...for now

  4. #4
    Registered User VirtualAce's Avatar
    Join Date
    Aug 2001
    Posts
    9,607
    Linker->Input->Additional dependencies

    d3dx9.lib, d3d9.lib, winmm.lib, dshow.lib, dinput.lib, dinput8.lib, dxguid.lib

    and anything else you might need.

  5. #5
    Computer guy
    Join Date
    Sep 2005
    Location
    I'm lost!!!
    Posts
    200
    It works ok with my VC++ 6 when i linked those lib. But the VC++ 2005 still give me the same error. :-(
    Hello, testing testing. Everthing is running perfectly...for now

  6. #6
    Absent Minded Programmer
    Join Date
    May 2005
    Posts
    968
    Make sure you do it in debug -and- release mode.

    There is a dropdown bar in the same place bubba sent you to.
    Sometimes I forget what I am doing when I enter a room, actually, quite often.

  7. #7
    Computer guy
    Join Date
    Sep 2005
    Location
    I'm lost!!!
    Posts
    200
    Quote Originally Posted by Shamino
    Make sure you do it in debug -and- release mode.

    There is a dropdown bar in the same place bubba sent you to.
    Yes, i did, and somehow it still not working, still give me the same error.
    Hello, testing testing. Everthing is running perfectly...for now

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Isometric Tile Engine using DirectX
    By Wraithan in forum Game Programming
    Replies: 3
    Last Post: 07-17-2006, 12:16 PM
  2. DirectSound header issues
    By dxfoo in forum C++ Programming
    Replies: 0
    Last Post: 03-19-2006, 07:16 PM
  3. DirectX - Starting Guide?
    By Zeusbwr in forum Game Programming
    Replies: 13
    Last Post: 11-25-2004, 12:49 AM
  4. DirectX 8 with Borland
    By Tommaso in forum Game Programming
    Replies: 11
    Last Post: 08-12-2003, 09:30 AM
  5. Directx SDK Documentation
    By Zoalord in forum Game Programming
    Replies: 4
    Last Post: 05-08-2003, 06:07 AM