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

Author Topic: SOLVED SFML can not open window.hpp  (Read 8759 times)

0 Members and 1 Guest are viewing this topic.

Bob man

  • Newbie
  • *
  • Posts: 3
    • View Profile
    • Email
SOLVED SFML can not open window.hpp
« on: May 20, 2021, 07:03:10 pm »
I keep getting a error message I don't know what is the problem. The error message is "1>C:\Users\user\source\repos\Sfml\External\include\SFML\Graphics.hpp(6,10): fatal error C1083: Cannot open include file: 'SFML/Window.hpp': No such file or directory"

Please help
« Last Edit: May 21, 2021, 12:53:51 am by Bob man »

Stauricus

  • Sr. Member
  • ****
  • Posts: 369
    • View Profile
    • A Mafia Graphic Novel
    • Email
Re: SFML can not open window.hpp
« Reply #1 on: May 20, 2021, 07:41:58 pm »
post your code, your OS, your SFML version (and how did you install it)
Visit my game site (and hopefully help funding it? )
Website | IndieDB

Bob man

  • Newbie
  • *
  • Posts: 3
    • View Profile
    • Email
I downloaded 2.5.1 32 bit
« Reply #2 on: May 20, 2021, 07:49:29 pm »
as for the code all I have is
#include <iostream>
#include "..\External\include\SFML\Graphics.hpp"
#include "..\External\include\SFML\System.hpp"
#include "..\External\include\SFML\Audio.hpp"
#include "..\External\include\SFML\Network.hpp"
#include "\External\include\SFML\Window.hpp"
using namespace std;
int main()
{
    cout << "Hello World!\n";
}
 
I am using windows 10. Installed it through sfml. I added dependencies for c/c++ general, dependencies for input and general

kojack

  • Sr. Member
  • ****
  • Posts: 343
  • C++/C# game dev teacher.
    • View Profile
Re: SFML can not open window.hpp
« Reply #3 on: May 20, 2021, 10:24:52 pm »
You are missing the .. on the window.hpp include line.
..\ means go back one directory. Just a \ at the start means go to the root directory of the hard drive, which is a very different location.

Bob man

  • Newbie
  • *
  • Posts: 3
    • View Profile
    • Email
Re: SFML can not open window.hpp
« Reply #4 on: May 20, 2021, 10:27:26 pm »
I tried it but it didn't help its more about it not finding the window.hpp in graphics.hpp

Stauricus

  • Sr. Member
  • ****
  • Posts: 369
    • View Profile
    • A Mafia Graphic Novel
    • Email
Re: SOLVED SFML can not open window.hpp
« Reply #5 on: May 21, 2021, 01:18:05 am »
there is no window.hpp in graphics.hpp  ???
you changed the path as kojack said?
Visit my game site (and hopefully help funding it? )
Website | IndieDB

kojack

  • Sr. Member
  • ****
  • Posts: 343
  • C++/C# game dev teacher.
    • View Profile
Re: SOLVED SFML can not open window.hpp
« Reply #6 on: May 21, 2021, 09:04:32 am »
Edit: Oh, I see the thread is now titled as solved. Cool. Ignore the below then. :)

No, there is a window.hpp include in graphics.hpp (line 32 in my version).

What did you set your include path to in your compiler? The graphics.hpp one is explicitly <SFML/Window.hpp> so it's looking in the include path for that. So you'd need to have External\include as part of the include path.
In visual studio c++, the addition includes setting is either relative to the project (where the .vcxproj file is) or an absolute path. If you are using mingw or something, that's not my area. :)

If you aren't sure how to get the correct include path, let us know the absolute path of where your window.hpp file is (for example c:\sdks\External\include\SFML\window.hpp) and the absolute path for your project file (for example C:\Users\kojack\source\repos\ConsoleApplication24\ConsoleApplication24.vcxproj).

« Last Edit: May 21, 2021, 09:06:39 am by kojack »

 

anything