If you wish you can provide the entire path in the include directive, i.e.:
#include <c:\program files\...\file.h>
That should work with no problems.
However, a better way is to tell the IDE where to look for included files. I'm not sure if anything's changed in Visual Studio 2005, but in 2003 you can go to Project ->
Properties... ->
C/C++ ->
Additional Include Directories, and include the path(s) there. This will make them available only to this solution. Alternatively, you can go to Tools ->
Options ->
Projects ->
VC++ Directories, select "
Include Files"
in the "
Show directories for:"
drop-down list, and add the directories there. This will make these include files available to every solution.
In these cases, you simply need to put:
#include <file.h>
with no path necessary.
The specific files you need to include depends on what you are doing. For example, I will outline the steps to get SDL working. Others should be a similar idea.
1. Download the SDL library. You will need one of the "
Source code"
items, available from
this page.
2. Extract these files anywhere on your computer. The directory doesn't matter. For example, c:\Program Files\SDL\
3. You now need the .lib and .dll files. You can build them youself by opening the .sln file found in the VisualC folder of what you just unzipped, and building it yourself. Alternatively, you can download the appropriate "
Development Library"
from the same page, which includes pre-built versions. It turns out the source is included in the Development Library, so if you download this you do not need to download the Source code above.
4. Place the .lib files (SDL.lib and SDLmain.lib) somewhere. For example, c:\Program Files\SDL\lib
5. Tell the IDE where to find the SDL include files as described above. In my example, you would provide the directory c:\program files\SDL\include
6. Tell the IDE where to find the SDL .lib file. Either Project ->
Properties ->
Linker ->
General, and add the directory containing the .lib file to "
Additional Library Directories"
or add it to the VC++ Library Directories in the same way as you could add the include directory, except selecting "
Library Files"
instead of "
Include Files"
. Then, in Project ->
Properties ->
Linker ->
Input, add SDL.lib and SDLmain.lib to "
Additional Dependencies"
.
7. Tell the IDE that this project will make use of one or more DLL files. Project ->
Properties ->
C/C++ ->
Code Generation, and change "
Runtime Library"
to "
Multi-threaded DLL"
or "
Multi-threaded Debug DLL"
(depending on the active configuration).
8. In your souce file(s) in which you want to use SDL functions, you need to #include<
SDL.h>
9. After compiling your program, you need to place SDL.dll in the same directory as the .exe (or, alternatively, in any directory the system PATH variable points to). If you do not do this, the program will compile fine, but running the .exe will complain about not being able to find SDL.dll.
That should be all. A basic introduction to using SDL can be found
here. It should be enough to get you started, anyways.
Hope this helps.
____________________________
+++++[>
+++++<
-]>
[>
+++>
++++>
+++++<
<
<
-]>
.>
+.>
-------.<
++++.+++++.
[Last edited by Kevin_P86 at 09-06-2007 12:41 AM : forgot a step - my bad]