dcsimg
CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 7 of 7

Thread: Unresolved External Symbol! Help!

  1. #1
    Join Date
    Jun 2003
    Posts
    25

    Unhappy Unresolved External Symbol! Help!

    Hey there,

    I am trying to create a Direct3D program, however when I try to compile and run the program I get the following error:

    PainterlyRenderer error LNK2019: unresolved external symbol _Direct3DCreate9@4 referenced in function "int __cdecl InitInstance(struct HINSTANCE__ *,int)" (?InitInstance@@YAHPAUHINSTANCE__@@H@Z)

    It seems that my program does not like the call to

    Direct3D_Object = Direct3DCreate9(D3D_SDK_VERSION);

    that I have defined in my program. I have declared all my variables (Direct3D_Object is of type LPDIRECT3D9) and I have included both:

    #include<C:\DX90SDK\Include\d3dx9.h>
    #include<C:\DX90SDK\Include\d3d9.h>

    in my program. So I'm not sure why my program can't find the Direct3DCreate9 function. (I have also linked my program to the libraries where this function is found).

    If anyone has any suggestions about what I am doing wrong, it would be greatly appreciated!

    Thanks
    Danielle

  2. #2
    Join Date
    Jun 2003
    Location
    Gjøvik, Norway
    Posts
    204

    Re: Unresolved External Symbol! Help!

    Originally posted by danielleM
    So I'm not sure why my program can't find the Direct3DCreate9 function. (I have also linked my program to the libraries where this function is found).
    Are you really sure about that? The Direct3DCreate9 function requires the d3d9.lib library according to MSDN. Could you please double-check that it really is being linked?

  3. #3
    Join Date
    Jun 2003
    Posts
    25
    Hey,

    Yea, I'm am sure, which is why I am confused myself.

    I went into Project\"Project Name Properties"\Linker\General\Additional Library Directories

    and added in where to find the direct3d libraries on my system.

    Any other suggestions? Or is there something more I need to do to link them into my program?

    Danielle

  4. #4
    Join Date
    Jun 2003
    Posts
    25
    Hey there,

    I found my problem...
    I had linked them in, but had never really "added" them to my program. It now works, since I physically added them into the files in my source view

    Danielle

  5. #5
    Join Date
    Feb 2005
    Posts
    1

    Question Re: Unresolved External Symbol! Help!

    Hi danielleM,
    I'm having the same problem you had long time ago.
    Can you tell me exactly what did you do to resolve it. ("added them into the files in my source view" ??? what is that??)
    Thanks,
    MasterLuLu

  6. #6
    Join Date
    Aug 2006
    Posts
    1

    Thumbs up Re: Unresolved External Symbol! Help!

    Hey, Just Encountered the same thing.... and solved it kind'a using what was writen here ....

    i had a problem i linked the x64 Lib files instead of the x86 .

    you may link the files using the proporties page
    Proj Proporties->Linker->Input->additional Dependencies=d3dx9.lib d3d9.lib

    for Win 9x, XP, 2000
    be sure your library directory is set to DXSDK/lib/x86

    for Win 64
    be sure your library directory is set to DXSDK/lib/x64

    wish it will help.

  7. #7
    Join Date
    Apr 2009
    Posts
    1

    Re: Unresolved External Symbol! Help!

    I encountered the same issue as well...

    In Visual Studio C++, I had to go to Tools->Options->Projects->VC++ Directories and choose "Show directories for:" in the upper right hand corner and select "Include files" -- and then enter the folder where the header files I'd be using are found.

    I also had to go to Project->Properties->Linker->Input->Additional Dependencies and enter the full path of the library file I'd be using

    I hope this helps someone out there =)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  


Windows Mobile Development Center


Click Here to Expand Forum to Full Width




On-Demand Webinars (sponsored)