Jump to content
  • Advertisement
Sign in to follow this  
ender7771

Getting Directx to run: compiles examples but not own code

This topic is 3815 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

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.

Share this post


Link to post
Share on other sites
Advertisement
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.

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!