Thread: error with directx init

  1. #1
    Handy Andy andyhunter's Avatar
    Join Date
    Dec 2004
    Posts
    540

    error with directx init

    I am using VC.NET version 2002 and i have just downloaded DirectX version 9. When I run created3d9 I get the linker error unresolved external for that macro. I believe I have included the lib directory with the sdk in my project (at least I believe I have). I tried searching through the messages but I guess I just don't understand the answers. If anyone can help that will be greatly appreciated.

  2. #2
    Registered User
    Join Date
    Aug 2003
    Posts
    1,218
    Did you actually LINK with the libraries you need???

  3. #3
    Handy Andy andyhunter's Avatar
    Join Date
    Dec 2004
    Posts
    540
    In the VS setup I have ensured the lib directory from the sdk was at the top as was said to ensure in the setup. I believe that VS then links from there. I included the d3d9 header file like all the sample apps. I have even added the d3d9.lib to the additional dependencies and still the same error.
    Last edited by andyhunter; 12-13-2004 at 02:55 PM.

  4. #4
    Registered User VirtualAce's Avatar
    Join Date
    Aug 2001
    Posts
    9,607
    Direct3DCreate9 Function

    --------------------------------------------------------------------------------

    Creates an instance of an IDirect3D9 object.

    Syntax

    IDirect3D9 *WINAPI Direct3DCreate9( UINT SDKVersion
    );
    Parameters

    SDKVersion
    The value of this parameter should be D3D_SDK_VERSION. See Remarks.
    Return Value

    If successful, this function returns a pointer to an IDirect3D9 interface; otherwise, a NULL pointer is returned.


    Remarks

    This function creates a IDirect3D9 object that supports enumeration of active display adapters and allows the creation of IDirect3DDevice9 objects. If the user dynamically adds adapters (either by adding devices to the desktop, or by hot-docking a laptop), those devices will not be included in the enumeration. Creating a new IDirect3D9 object will expose the new devices.

    D3D_SDK_VERSION is passed to this function to ensure that the header files against which an application is compiled match the version of the runtime dynamic-link library (DLL)'s that are installed on the machine. D3D_SDK_VERSION is only changed in the runtime when a header change (or other code change) would require an application to be rebuilt. If this function fails, it indicates that the header file version does not match the runtime DLL version. See DirectX Version Checking for help checking the version of the runtime that is installed on your machine.

    Function Information

    Header d3d9.h
    Import library d3d9.lib
    Minimum operating systems Windows 98


    --------------------------------------------------------------------------------
    created3d9 is not part of the library.

  5. #5
    Handy Andy andyhunter's Avatar
    Join Date
    Dec 2004
    Posts
    540
    Im sorry I meant Direct3DCreate9. I gone one project to work but when I moved to the next project the error showed up again. I have the lib dir listed at the top for VS to search. I have explicitly included d3d9.lib and the dir in the project under the linker tab and yet on THIS project I still recieve the unresolved external error. I am about ready to put my fist through this monitor. I am not sure why it is working on one project and the exact same code does not compile in the different project. Any suggestions?

  6. #6
    Handy Andy andyhunter's Avatar
    Join Date
    Dec 2004
    Posts
    540
    OK , I feel like an idiot. Even though I had the library listed I didn't include it in the additional dependecies block. Everthing appears to be working now. Thanx for the patience you guys had with me and my stupidity.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. init adopts zombie process?
    By password636 in forum Linux Programming
    Replies: 4
    Last Post: 07-01-2009, 10:05 AM
  2. Isometric Tile Engine using DirectX
    By Wraithan in forum Game Programming
    Replies: 3
    Last Post: 07-17-2006, 12:16 PM
  3. DirectSound header issues
    By dxfoo in forum C++ Programming
    Replies: 0
    Last Post: 03-19-2006, 07:16 PM
  4. DirectX - Starting Guide?
    By Zeusbwr in forum Game Programming
    Replies: 13
    Last Post: 11-25-2004, 12:49 AM
  5. Directx SDK Documentation
    By Zoalord in forum Game Programming
    Replies: 4
    Last Post: 05-08-2003, 06:07 AM