Jump to content
  • Advertisement
Sign in to follow this  
scarred_gamer

DirectX Problems

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

Hello, i'm new to this forum and I've been having some problems compiling the source code of varies programs i need in C++ the errors I get are around 7-8 saying how "filename.h" could not be found or no such directory. How would I go about fixing this problem?

Share this post


Link to post
Share on other sites
Advertisement
When you include files the compiler looks for them in the paths you have set up and the local directory. Make sure your compiler has the correct paths. If the headers are DirectX ones you need paths to the DirectX include directory and library directory. You normally set these paths across all projects so depending on your compiler you need to set them e.g. in .net you go to tools/options then select the projects list and then CV++ Directories. Other compilers will have similar options.

Share this post


Link to post
Share on other sites
The compiler cannot find the file you need so basically you can do 2 things:
1) put the file in that directory
2) instruct the compiler to go to see in that directory.
Depends on what compiler you use.

In LCC compiler the -I flag do this job. You can change it from:
Compiler -> Settings -> include path
In MSVC++ the /I. You can change it from:
Project - >Settings -> C++ -> Preprocessor -> Additional Include Directories
In GCC the -I flag

Share this post


Link to post
Share on other sites
It worked but now it can't fine "dinput8.lib" it compiled fine but the exe said that it couldn't find that file. thanks to both of you for your help

Share this post


Link to post
Share on other sites
Ok, seems the samples are still giving me these nasty errors. I keep doing what you guys said but still it tells me that certain files can't be included cause they aren't found

Share this post


Link to post
Share on other sites
Well first you do have directx installed right? and also do you have the path set up correctly? I am using VC 2005 beta so it may be different for you but for me its under tools->options->VC++ Directories then inside of that change the "show directories for" box to library files and then add the path of the directx lib i.e. <directx install path>\lib\x86. then switch the library files to include files and add <directx install path>\Include. after that the only other thing to do is to go into your project's properties and add the library files that you are trying to use to the linker input. for me it was Project-><project's name> Properties->Linker->Input and then on the additional dependancies line add your .lib files i.e. d3d9.lib, d3dx9.lib, etc... Hope that helps and gl

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.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!