Jump to content
  • Advertisement
Sign in to follow this  
Ratslayer

Linker error LNK2001 for DirectX 10

This topic is 2270 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hello, I have a problem with building my program, for some reason. It gives me the following error in multiple places:
error LNK2001: unresolved external symbol "public: struct ID3D10Device * __thiscall Dx10Manager::GetDevice(void)" (?GetDevice@Dx10Manager@@QAEPAUID3D10Device@@XZ)

Somehow it cannot find the code for the ID3D10Device struct. I have added the required folders to both library and include paths. I have also added the required .lib files to additional dependencies and added the #pragma comment(lib, ...) for both d3d10.lib and d3dx10.lib (not sure if it is redundant - doesn't work with or without either way).

In fact, my project properties are exactly the same as the ones in a tutorial sample, with the exceptance of me adding the Nvidia PhysX folders to both library and include paths. However the sample compiles just fine, while my project doesn't.

I am not sure if adding additional folders can screw up the .lib files search. I also don't know if there is any code that is relevant to the case. What else can be the problem? Thank you for your time.

Share this post


Link to post
Share on other sites
Advertisement
That Dx10Manager class does not look familiar to me, is this a class you built yourself?
If so, you probably forgot to implement the GetDevice function of said class

It does find the code for the ID3D10Device, it just doesn't find the code for your GetDevice function

Share this post


Link to post
Share on other sites
Somehow it cannot find the code for the ID3D10Device struct. I have added the required folders to both library and include paths. I have also added the required .lib files to additional dependencies and added the #pragma comment(lib, ...) for both d3d10.lib and d3dx10.lib (not sure if it is redundant - doesn't work with or without either way).[/quote]
You're actually reading the error wrong. The linker is saying that it cannot find this symbol:

[background=rgb(250, 251, 252)]?GetDevice@Dx10Manager@@QAEPAUID3D10Device@@XZ[/background][color=#282828][font=helvetica, arial, verdana, tahoma, sans-serif]

[background=rgb(250, 251, 252)], which when unmangled looks like "[/background][/font][color=#282828][font=helvetica, arial, verdana, tahoma, sans-serif]

[background=rgb(250, 251, 252)]public: struct ID3D10Device * __thiscall Dx10Manager::GetDevice(void)."[/background][/font]



[color=#282828][font=helvetica, arial, verdana, tahoma, sans-serif]

[background=rgb(250, 251, 252)]This symbol is not part of the D3D library, it looks like something you wrote. Mostly likely you are missing the implementation -- either because you mislabeled it (perhaps you forgot to put "Dx10Manager::" in front of the function definition's name) or because the source file containing it isn't being compiled for one reason or another.[/background][/font]

Edited by Josh Petrie

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!