Jump to content
  • Advertisement
Sign in to follow this  
Matthew Shockley

C++ Linker Errors

This topic is 3003 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

I am new to Visual C++ 2008 but everytime I try to use my DXUT program with DirectX, I keep getting this error and similar errors like it: error LNK2019: unresolved external symbol "void __stdcall OnD3D9DestroyDevice(void *)" (?OnD3D9DestroyDevice@@YGXPAX@Z) referenced in function _wWinMain@16 I don't know how to work the linker, so can someone help me. I am also new to this forum, so if I posted this in the wrong section, I'm sorry.

Share this post


Link to post
Share on other sites
Advertisement
Looks like you havn't added the library to the libraries list in the project properties.

Share this post


Link to post
Share on other sites
The error essentially means that at link time, the linker could not find the implementation of the function in that error. So either you have not written the implementation when you should have done, or you have not linked the library that contains the implementation. I've never used DXUT so i don't know whether it builds to a library.

Edit: I just ran up one of the SDK examples and the aforementioned function is implemented in DXUTGui.cpp and that resides in the example solution. Do you have it in your solution?

Share this post


Link to post
Share on other sites
I'm not too familiar with DXUT, but I think that function is not part of it. You're supposed to define it yourself, just like you defined OnMouse, OnDeviceRemoved, etc. Or you can just remove the call to DXUTSetCallbackD3D9DeviceDestroyed (I'm guessing you're not required to register callbacks, but I could be wrong).

Here's a guide for using DXUT.

Share this post


Link to post
Share on other sites
Quote:
Original post by Matthew Shockley
Here is my exact code:

http://pastebin.com/qmjMcL2J


And where is the function OnD3D9DestroyDevice(void *) defined?

Share this post


Link to post
Share on other sites
You've defined OnD3D10DestroyDevice but not OnD3D9DestroyDevice. You've declared it, but you haven't provided the definition (source code) so the linker is complaining.

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.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!