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

Author Topic: Code blocks: No such file or directory - SFML\system.hpp  (Read 17881 times)

0 Members and 1 Guest are viewing this topic.

Jwake315@aol.com

  • Newbie
  • *
  • Posts: 3
    • View Profile
Code blocks: No such file or directory - SFML\system.hpp
« on: March 12, 2011, 06:21:53 pm »
Hi, new to C++ and trying to install SFML. I Followed the getting started tutorial but think I might have missed something. I'm sure moderators are sick of seeing this question but i cant seem to find the solution.

Im using Code::blocks 10.05. and believe mingw is installed correctly. I can run any typical console program.

Global Compiler search directories are set to the SFML include and lib folders. Project Build options compiler paths are also pointing there.

Under project build options 'Test - release':
Linking one library; 'libsfml-system.a' One  linker option '-libsfml-system'

Just trying to compile the "First SMFL program" tutorial

Code: [Select]
#include <iostream>
#include <SFML\System.hpp>

int main()
{
    sf::Clock Clock;
    while (Clock.GetElapsedTime() < 5.f)
    {
        std::cout << Clock.GetElapsedTime() << std::endl;
        sf::Sleep(0.5f);
    }

    return 0;




When i try to run it gives me the error;
fatal error: SFML\System.hpp: No such file or directory

It feels to me like in the line
Code: [Select]
#include <SFML\System.hpp>
SFML is a path variable

If i replace SFML with the path to SFML include folder it will continue to compile until it comes to the headers within system.hpp which also have the same #include <SFML\etc.> setup.

So basically where is this variable set. Global variables , User variables or am I not even in the ballpark?

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32504
    • View Profile
    • SFML's website
    • Email
Code blocks: No such file or directory - SFML\system.hpp
« Reply #1 on: March 12, 2011, 07:29:00 pm »
If you followed the tutorial you shouldn't get this error. I don't know what else to say, check again that you didn't forget anything, or did  something wrong.
Laurent Gomila - SFML developer

James

  • Newbie
  • *
  • Posts: 6
    • View Profile
Code blocks: No such file or directory - SFML\system.hpp
« Reply #2 on: March 12, 2011, 07:36:08 pm »
Shouldn't it be a slash instead of a backslash?
ie
#include <SFML/System.hpp>

Jwake315@aol.com

  • Newbie
  • *
  • Posts: 3
    • View Profile
Code blocks: No such file or directory - SFML\system.hpp
« Reply #3 on: March 12, 2011, 08:29:16 pm »
Oh yeah whoops. fixed that but same error

I just Figured it out though. didn't think it was necessary but I put the SFML/include/SFML folder into my mingw/include folder. after that everything compiled good. so i guess its looking in mingw/include. I never told it to look there though and I would think by adding those SFML/include and lib directories in the global compiler settings and the Project Build options it would look there as well. hmm

If anybody has any thoughts there that would be cool. Now I'm curious.

But dont fix what isn't broken though i guess.

silentdth

  • Newbie
  • *
  • Posts: 2
    • View Profile
Code blocks: No such file or directory - SFML\system.hpp
« Reply #4 on: March 05, 2012, 12:19:51 pm »
I also encountered this problem, and had to copy the SFML/include/SFML folder into my mingw/include folder.

An idea was to add the c:\program files\SFML to my PATH... but I don't think that will work as the path is looking at MINGW\bin, which does not include MINGW\include.

 

anything