C++ Linker Errors

Started by
8 comments, last by taz0010 14 years ago
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.
If I asked you for a hundred dollars would the answer to that question be the same as the answer to this question?
Advertisement
Looks like you havn't added the library to the libraries list in the project properties.
Which library should I link?
If I asked you for a hundred dollars would the answer to that question be the same as the answer to this question?
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?
I do have the DXUTGui.cpp file in my solution but its still not working.
If I asked you for a hundred dollars would the answer to that question be the same as the answer to this question?
Here is my exact code:

http://pastebin.com/qmjMcL2J
If I asked you for a hundred dollars would the answer to that question be the same as the answer to this question?
Anyone? Thanks though, Dave, you are very helpful. I rated you high.
If I asked you for a hundred dollars would the answer to that question be the same as the answer to this question?
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.
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