SFML community forums
Help => General => Topic started by: Mindiell on August 18, 2007, 09:56:55 am
-
Hi,
I tried to compile the first example of the "Code::Blocks" tutorial, but I installed all include files on another directory than SFML/...
Thus, the compiler stop on this :
#include <SFML/System/Clock.hpp>
#include <SFML/System/Lock.hpp>
#include <SFML/System/Mutex.hpp>
#include <SFML/System/Randomizer.hpp>
#include <SFML/System/Sleep.hpp>
#include <SFML/System/Thread.hpp>
Can't it be a simple path just like this :#include <System/Clock.hpp>
-
You must keep SFML as the root directory for the SFML include files.
It is generally a good idea to have the library name as the root in the include directives, as it can contain very common file names that could also belong to other libraries (I'm sure I can find another library which include a <System/Clock.hpp> file).
With the library name as the first directory, it simply avoids conflicts.
-
Configuring the compiler's include paths can ease much the stuff.
Tell him to look at Path/To/SFML/include when searching headers in its include directories.
-
I use sirectories like this on my projects :
Projects
-- Project A
-- Project B
-- Externals objects
-- Spriteobject
-- Sceneobject
-- Project C
-- Externals libraries
-- SDL
-- SDL_image
-- lua
-- SFML
and each library directory contains :
Library directory
-- include
-- dlls
-- lib
I, further, set compiler options like this (include example only there) :
- ..\External libraries\SDL\include
- ..\External libraries\SDL_image\include
- ..\External libraries\SFML\include
This is why I'm not using include\SFML\...
It's maybe strange, but I prefer this kind of directories architecture for updates : when I update SDL_image, I just delete the old directory and recreate a new, forgetting onthing...
-
But inside SFML/include there must be a "SFML" directory.
If not, you can set it.
-
Yep I deleted it :)
I tried changing all include files, and this is working properly.
But I've no more the orginial downloaded .hpp files...
Maybe, I'll try to change my architecture or convince you to change those damn includes :wink:
-
Maybe, I'll try to change my architecture or convince you to change those damn includes
These are not "damn includes" ;)
As I said, there is a good reason behind this choice, and even if it conflicts are unlikely to happen, it would be unsafe to do it the way you do.
-
Maybe, I'll try to change my architecture or convince you to change those damn includes :wink:
Don't tell me you do that sort of thing with the likes of Boost :D
-
??? I'm not using boost.
And finally I changed all my architecture in order to use SFML :wink: