Sign in to follow this  
Matthew Shockley

C++ Linker Errors

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
dave    2187
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
Gage64    1235
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
the_edd    2109
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
taz0010    277
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

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this