Welcome, Guest. Please login or register. Did you miss your activation email?

Author Topic: includes files  (Read 9852 times)

0 Members and 2 Guests are viewing this topic.

Mindiell

  • Hero Member
  • *****
  • Posts: 1261
    • ICQ Messenger - 41484135
    • View Profile
includes files
« 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 :
Code: [Select]
#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 :
Code: [Select]
#include <System/Clock.hpp>
Mindiell
----

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32504
    • View Profile
    • SFML's website
    • Email
includes files
« Reply #1 on: August 18, 2007, 10:53:11 am »
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.
Laurent Gomila - SFML developer

Alp

  • Jr. Member
  • **
  • Posts: 56
    • MSN Messenger - alpmestan@hotmail.com
    • View Profile
    • http://alp.developpez.com/
    • Email
includes files
« Reply #2 on: August 18, 2007, 10:54:55 am »
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.
SFML developper

Mindiell

  • Hero Member
  • *****
  • Posts: 1261
    • ICQ Messenger - 41484135
    • View Profile
includes files
« Reply #3 on: August 18, 2007, 12:06:38 pm »
I use sirectories like this on my projects :
Quote

Projects
  -- Project A
  -- Project B
  -- Externals objects
      -- Spriteobject
      -- Sceneobject
  -- Project C
  -- Externals libraries
       -- SDL
       -- SDL_image
       -- lua
       -- SFML

and each library directory contains :
Quote

Library directory
  -- include
  -- dlls
  -- lib


I, further, set compiler options like this (include example only there) :
Quote
- ..\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...
Mindiell
----

Alp

  • Jr. Member
  • **
  • Posts: 56
    • MSN Messenger - alpmestan@hotmail.com
    • View Profile
    • http://alp.developpez.com/
    • Email
includes files
« Reply #4 on: August 18, 2007, 12:10:54 pm »
But inside SFML/include there must be a "SFML" directory.

If not, you can set it.
SFML developper

Mindiell

  • Hero Member
  • *****
  • Posts: 1261
    • ICQ Messenger - 41484135
    • View Profile
includes files
« Reply #5 on: August 18, 2007, 12:15:01 pm »
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:
Mindiell
----

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32504
    • View Profile
    • SFML's website
    • Email
includes files
« Reply #6 on: August 18, 2007, 12:28:59 pm »
Quote
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.
Laurent Gomila - SFML developer

schmedly

  • Newbie
  • *
  • Posts: 7
    • View Profile
includes files
« Reply #7 on: August 22, 2007, 03:40:23 am »
Quote from: "Mindiell"

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

Mindiell

  • Hero Member
  • *****
  • Posts: 1261
    • ICQ Messenger - 41484135
    • View Profile
includes files
« Reply #8 on: August 22, 2007, 08:05:01 am »
??? I'm not using boost.
And finally I changed all my architecture in order to use SFML  :wink:
Mindiell
----

 

anything