Sign in to follow this  

a simple directx question

This topic is 4413 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

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?

Share this post


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

Share this post


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

Share this post


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

Share this post


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

Share this post


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

Share this post


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

Share this post


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

Share this post


Link to post
Share on other sites
barodapride - i'd really recommend downloading and installing vc++ 2005 Express.
It's free, it's a huge improvement over 6.0 (I think it's even a huge improvement over 2003), and it definitely makes things easier for the newbie. You'll also need .net 2.0. and i'd recommend getting the windows sdk if you want to write unmanaged code (which is what most tutorials are written in for c++).

as for x86 vs x64

x86 processors are based on the architecture of the first intel microprocessor family - 80x86 (or x86). the x is because the family of processors on this architecture were called 8086, 80186, 80286, and the (possibly more familiar) 386, and 486.
the major update between processors of those days and current ones (well, one major update) is the switch from 16-bit to 32-bit instructions... intel called the upgraded architecture IA-32, but i guess for reasons of marketing/recognition the old x86 title stuck...

these days there's been another update that's recently gained popularity in the consumer/home user market, which is 64-bit instruction sets... AMD calls this AMD64, intel calls it EM64T, and microsoft (who doesnt even make processors so who knows what right they've got...) calls it x64 - which is the folder you found before...

so, that's a general explanation of that - im sure theres a million pages on google about it...

also, the first AP was right, vc++ 6 isn't officially supported anymore - most things probably work fine but that's just a WAG, as i never used directx with 6.0 - let alone the current dx sdk's...

Share this post


Link to post
Share on other sites

This topic is 4413 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.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this