Unresolved external symbol

Started by
3 comments, last by gfreak5 18 years, 10 months ago
I just got Microsoft Visual C++ 6.0, but as soon as i tried to build a directX 9 program i got the error "unresolved external symbol _Direct3DCreate9@4" I linked both d3d9.h and d3dx9.h, and have added the folder to the directories in the program. If someone could help me with this or point me to a thread that actually explains this, id be very obliged. Thank you.
Advertisement
"I linked both d3d9.h and d3dx9.h"

You cant link h files you include them. You need to link d3d9.lib and d3dx9.lib IIRC.
In order for it to work include the files you mentioned and also add the
d3d9.lib and d3dx9.lib files in the Project->Settings under the Link tab Object/Library modules.
There is nothing that can't be solved. Just people that can't solve it. :)
You might also link knowing that you can link in the source file itself, vs. hidden off in the project files by using:
#pragma comment( lib, "d3dx9.lib" )

just stash that up near your includes for good measure. No semi-colin, as with all compiler directives.
Thanks guys, that really helped. I meant that included them in my first post, sorry about that. I went and linked everything, but then it said that i have an "invalid machine type" and cant open the library. What is that? Sorry about asking so many questions, but im just getting into DirectX, thank you again for all help.

This topic is closed to new replies.

Advertisement