a simple directx question

Started by
9 comments, last by c0uchm0nster 18 years, 5 months ago
So I'm quite new to this, I'm following a tutorial I got from experiments in game programming about how to make breakout. Anyway the very first thing it shows how to do is make a blank window. I copied all the code, downloaded directx 9 sdk and it doesnt build because "cannot open the file "d3d9.lib". I just went throught the installation that directx 9 did automaticall so I guess I just dont know how to tie the library into the code. Anyone out there know?
Advertisement
what environment are you developing in? In .net you can do it a number of ways. you can either do a

#pragma comment (lib, "the library you need goes here")

or in your project settings go to Linker->input->additional dependencies and put the libraries you need in that line.
It depends on what IDE you are using. If you are using Visual Studio, try adding this line to the top of your main.cpp:-

#pragma using( lib, "path/to/d3d9.lib" )

If you are using Dev-C++, then add this line to the project options:-

-lpath/to/d3d9.a

NOTE: The above line is .a even though d3d9.dll is a .dll. Just type the path to d3d9.dll straight after the -l with no spaces.
#pragma comment(lib,"d3d9.lib")

that's the line in my code, I am using visual studio c++ 6.0

I dont know where the library is located since it installed itself automatically - I guess I am just a true newbie to get stuck on something like this. Thanks for the help.
OK I found out the location of the library is here:

C:\Program Files\Microsoft DirectX 9.0 SDK (October 2005)\Lib\x64

when I paste this into the " " its giving me some weird errors like invalid machine type, I changed the \ to a / since someone who responded showed doing it like that but it still doesnt work. Is it because of the spaces? What is wrong? I added the /d3d9.lib on the end of the path. Help appreciated!
Quote:Original post by barodapride
OK I found out the location of the library is here:

C:\Program Files\Microsoft DirectX 9.0 SDK (October 2005)\Lib\x64

when I paste this into the " " its giving me some weird errors like invalid machine type, I changed the \ to a / since someone who responded showed doing it like that but it still doesnt work. Is it because of the spaces? What is wrong? I added the /d3d9.lib on the end of the path. Help appreciated!



The "x64" folder contains libraries for 64-bit Windows. Thus you need a 64-bit compiler, processor and of course a copy of 64-bit Windows to run the compiled program. So use the libraries in the "x86" folder instead.

Also, you can set up build paths in VC++ 6 by going into the Tools/Options menu and add include and library paths under the "Directories" tab. VC++ will look for files in the order they are listed on the list.
I think the DX9 SDK doe snot support VC++ 6 anymore.
Ok it works with the x86 folder. What is x86 anyway? Thanks a ton for the help!
Quote:Original post by barodapride
Ok it works with the x86 folder. What is x86 anyway? Thanks a ton for the help!


I'm pretty sure that x86 represents a 32-bit machine, and x64 represnets a 64-bit machine. Don't ask me why, it just does [grin]
iam just a beginer at maya 7 ple i just downlaod it and i have this book for it i need help because in the book it tells me to go to creat poloygon tool then make the figure showen then extrude egdes and then it tells me to go to modify>convert>poloygon to subdiv i do all of this and when i go to click on poloygon to subdiv a waring thing shows up and says that it only works on polygon sufaces so if i could get some help that would be great thx.

This topic is closed to new replies.

Advertisement