I keep having this error:
cannot open this source file
what to do pls?
Edited by Jaey, 17 February 2013 - 01:57 PM.
Jump to content
Posted 17 February 2013 - 03:46 PM
Did you add SDL's headers to your compiler's include path?
When you do #include "another file", your compiler looks for 'another file' in a series of locations, and if it can't find the file in any of those locations, it gives an error.
The locations depend on what compiler you are using, but mine goes something like this:
I might have the order wrong, but it checks all those locations in some order or another, until it finds the file it is looking for.
If using '<' and '>' brackets, like #include <file>, the compiler I use checks the compiler's include directory first (usually the standard library headers).
So, if you are wanting to use SDL, you'll need to:
A) Link to SDL, using the linker file (the exact details depend on your IDE)
B) Make sure the DLL files are either in your operating system's %PATH% environmental variable, or else alongside your executable.
C) Add SDL's include files either in the compiler's include directory, or else add a user-defined include directory.
I suggest starting with Lazy Foo's SDL tutorials - they'll walk you through how to get SDL up and running with a custom tutorial for whatever IDE you use. The entire tutorial is an excellent introduction to SDL, in my opinion.
Posted 18 February 2013 - 09:03 AM
In addition to all of the above points, the standard and most "cross-platform" way to include SDL is:
thanks a lot. that seems to have been the issue. Thanks again
Edited by Jaey, 18 February 2013 - 09:04 AM.