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

Author Topic: C++ cannot open source file  (Read 2408 times)

0 Members and 1 Guest are viewing this topic.

hzinsanoglu

  • Newbie
  • *
  • Posts: 2
    • View Profile
C++ cannot open source file
« on: May 15, 2022, 01:54:05 pm »
I am new to SFML and Visual Studio. I followed a tutorial on youtube to implement SFML and it went fine up untill the end when I tried to run an example. Now, although I included all the files etc. in project properties section it won't see the files and throw an error at include. What should I do? Please explain in a way easy to understand as I am newbie. I included an image in the attachments.

Severity   Code   Description   Project   File   Line   Suppression State
Error   C1083   Cannot open include file: 'SFML/Graphics.hpp': No such file or directory   SFML   C:\Users\Mert\source\repos\SFML\SFML\SFML.cpp   1   

Stauricus

  • Sr. Member
  • ****
  • Posts: 369
    • View Profile
    • A Mafia Graphic Novel
    • Email
Re: C++ cannot open source file
« Reply #1 on: May 15, 2022, 03:01:54 pm »
well, simply put, Visual Studio isn't finding the header file Graphics.hpp.
in what folder exactly did you put the SFML headers and etc? can you show us the complete folder path?
Visit my game site (and hopefully help funding it? )
Website | IndieDB

hzinsanoglu

  • Newbie
  • *
  • Posts: 2
    • View Profile
Re: C++ cannot open source file
« Reply #2 on: May 15, 2022, 08:45:58 pm »
well, simply put, Visual Studio isn't finding the header file Graphics.hpp.
in what folder exactly did you put the SFML headers and etc? can you show us the complete folder path?

I am terribly sorry for the late reply despite your early help. If you are asking for the pathway where teh downloaded sfml file is, it is C:\Users\Mert\SFML-2.5.1 . However, if you meant the source files included for the project specifically it is C:\Users\Mert\source\repos\SFML and in it is a different SFML file with x64 file (debug and release).

Stauricus

  • Sr. Member
  • ****
  • Posts: 369
    • View Profile
    • A Mafia Graphic Novel
    • Email
Re: C++ cannot open source file
« Reply #3 on: May 16, 2022, 05:52:34 pm »
the source files. have a check if the path is correct, it contains the SFML folder twice in your error:
C:\Users\Mert\source\repos\SFML\SFML\SFML.cpp

try to include files in your source code just with
#include "Graphics.hpp"

OR

change the configurations from Visual Studio to look for header files in the path "C:\Users\Mert\source\repos\" instead of "C:\Users\Mert\source\repos\SFML\".
Visit my game site (and hopefully help funding it? )
Website | IndieDB