Direct3D Problem

This is a discussion on Direct3D Problem within the Game Programming forums, part of the General Programming Boards category; Ok i have: Code: #include <d3d9.h> LPDIRECT3D9 pD3D = NULL; LPDIRECT3DDEVICE9 pD3D_Device = NULL; if( NULL == (pD3D = Direct3DCreate9(D3D_SDK_VERSION))) ...

  1. #1
    Call me AirBronto
    Join Date
    Sep 2004
    Location
    Indianapolis, Indiana
    Posts
    195

    Direct3D Problem

    Ok i have:
    Code:
    #include <d3d9.h>
    LPDIRECT3D9 pD3D = NULL;
    LPDIRECT3DDEVICE9  pD3D_Device = NULL; 
    if( NULL == (pD3D = Direct3DCreate9(D3D_SDK_VERSION)))
    {
    //failed    
    }
    And i get the error:

    [Linker error] undefined reference to `Direct3DCreate9@4'

    I am using DirectX9 of course, and Dev V4.9.9.2

    Thanks for the help

  2. #2
    Super Moderator VirtualAce's Avatar
    Join Date
    Aug 2001
    Posts
    9,590
    Ok this is terrible. Let's do a comparitive search on how many times Problems with DirectX this or that occurs in same thread as Dev C.

    Dev C is probably the single largest thread-generator about problems in DX.

    My advice, dump the ........ and get MSVC or something else.

    I'm sorry I do not have the answer to your problem, but please, please, please, use something more compatible or that you don't have to hold your right pinky to your left ankle, turn to face exactly 125 degrees, and at the same time hit the compile button for it to work.

  3. #3
    ---
    Join Date
    May 2004
    Posts
    1,379
    Yeah the DX libs just don't seem to work with gcc, even though, by the look of it your not even linking the libraries.

  4. #4
    Call me AirBronto
    Join Date
    Sep 2004
    Location
    Indianapolis, Indiana
    Posts
    195
    Yea i was afrade of that. Thanks for the responses any way.

  5. #5
    Call me AirBronto
    Join Date
    Sep 2004
    Location
    Indianapolis, Indiana
    Posts
    195
    Which one should i use then becouse i have 6.0 and when i add all my source files to a project i get a whole bunch of errors that make no sence.

  6. #6
    Registered User
    Join Date
    Jan 2005
    Posts
    847
    MSVC 6.0 is no longer suported by directx, use a later version. You can download MSVC 2005 express for free.
    Remember to link to the d3d library, either in your project settings or using a pragma statement.
    Code:
    #pragma comment(lib, "d3d9.lib")
    PS: Direct3DCreate9 is being called outside of a function but I'm assuming thats not how your actual program looks.

  7. #7
    Super Moderator VirtualAce's Avatar
    Join Date
    Aug 2001
    Posts
    9,590
    You can use MSVC 6.0 if you copy the basetsd.h file stickied at the top of the game programming forum's main page.

    There are no other problems that I know of in DX related to using MSVC or .NET 2003 or 2005.

    basetsd.h is also available in the Windows SDK or Platform SDK. If you installed the MSDN library then you should have basetsd.h already on your drive. Simply point your compiler to this or copy the file and stick it in the folder for your project. MSVC should already know where basetsd.h is and will find it when you include it.

    EDIT: I also have Enterprise edition which comes with the Platform SDK. So basetsd.h was already installed on my system. The student edition of MSVC will not have this. This is why we made basetsd.h available on this forum. You MUST have this to compile DirectX programs using MSVC 6.
    Last edited by VirtualAce; 12-28-2005 at 03:39 PM.

  8. #8
    Registered User
    Join Date
    Nov 2005
    Posts
    4

    I've never ...

    I've never had problems with the DirectX 9 SDK using Visual C++ 6.0. I have VS 6.0 Enterprise Edition. And I have done quite a bit of DX9, and never had problems as far as linking to DX9, etc.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. A question related to strcmp
    By meili100 in forum C++ Programming
    Replies: 6
    Last Post: 07-07-2007, 02:51 PM
  2. WS_POPUP, continuation of old problem
    By blurrymadness in forum Windows Programming
    Replies: 1
    Last Post: 04-20-2007, 06:54 PM
  3. Need help with getting DirectX 9.0 initilization
    By DarkMortar in forum Windows Programming
    Replies: 7
    Last Post: 05-09-2006, 08:58 PM
  4. Direct3D problem
    By cboard_member in forum Game Programming
    Replies: 10
    Last Post: 04-09-2006, 03:36 AM
  5. Laptop Problem
    By Boomba in forum Tech Board
    Replies: 1
    Last Post: 03-07-2006, 05:24 PM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21