DirectX Problems

Started by
6 comments, last by scarred_gamer 18 years, 11 months ago
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?
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.
------------------------See my games programming site at: www.toymaker.info
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
[ILTUOMONDOFUTURO]
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
never mind i figured it out
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
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
I found the help i needed all along in the documention thanks for all your help

This topic is closed to new replies.

Advertisement