C++ Linker Errors
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.
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?
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?
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.
Here's a guide for using DXUT.
Quote:Original post by Matthew Shockley
Here is my exact code:
http://pastebin.com/qmjMcL2J
And where is the function OnD3D9DestroyDevice(void *) defined?
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.
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement