Skip to main content
GameDev.net gamedev.net
🔒 Locked

Getting Directx to run: compiles examples but not own code

Started by ender7771 Jan 12, 2008 at 11:30 AM 3 replies 1.1k views
Original Post
ender7771
ender7771
I installed VC++ express 08 and the directx sdk. I followed the instructions presented at a number of sites, and finally got all of the included directx tutorials (such as the trippin' triangle) to compile. But when I start a blank project in VC++ and simply copy + paste working code, and then compile, I get teh following errors: error LNK2019: unresolved external symbol _Direct3DCreate9@4 referenced in function "long __cdecl InitD3D(struct HWND__ *)" (?InitD3D@@YAJPAUHWND__@@@Z) (my directory): fatal error LNK1120: 1 unresolved externals Is there something else I need to link, that the tutorials automatically included? I googled and such, and have not been able to resolve the error. I dont have a broadband connection, so simply getting visual express and the directx sdk was a hassle and now it is very frustrating that it is not working. I saw that some websites also said to download the platform sdk, but the examples compiled fine without it, it is just when I try to do my own code that everythign fails. Obviously, getting the platform sdk would be a large hassle for me right now (Id probably have to order it and wait like 4 weeks for it to arrive); I want to start programming in directx now. Does anyone know if setting up opengl is relatively easier do to? I am not a novice programmer by any definition, and i want to move towards 3d graphics and such, but it is so frustrating because of my lack of resources (ie the internets). I would appreciate any and all help.
SiCrane
SiCrane
Did you add d3d9.lib to your project?
ender7771
ender7771
My linker points to the directory in which d3d9.lib resides; do I have to manually add it in? I am more familiar with devc++, where you would tell the linker exactly which files to add in.
MJP
MJP
It's the same as DevC++, you must add d3d9.lib (as well as d3dx9.lib, if you're using it) to the list of additional dependencies in your linker settings. You can find this in Project Properties->Linker->Input.
ender7771
ender7771
Quote:
Original post by MJP
It's the same as DevC++, you must add d3d9.lib (as well as d3dx9.lib, if you're using it) to the list of additional dependencies in your linker settings. You can find this in Project Properties->Linker->Input.


Thank you- that got everything to work.

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.