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

Author Topic: Cannot open included file. Newbie problem!  (Read 19597 times)

0 Members and 1 Guest are viewing this topic.

PetruZ

  • Newbie
  • *
  • Posts: 3
    • View Profile
Cannot open included file. Newbie problem!
« on: June 07, 2013, 03:47:18 pm »
Hi, I just finished setting up SFML on Visual c++ 2010. I used the simple code that is included on SFML's tutorial page and I get an error saying:

fatal error C1083: Cannot open include file: 'SFML/Graphics.hpp': No such file or directory

I have no idea what the problem is, I've searched to find an answer without success. What am I doing wrong?

Nexus

  • SFML Team
  • Hero Member
  • *****
  • Posts: 6286
  • Thor Developer
    • View Profile
    • Bromeon
Re: Cannot open included file. Newbie problem!
« Reply #1 on: June 07, 2013, 03:56:17 pm »
Please read the tutorial carefully. Everything is explained.
Zloxx II: action platformer
Thor Library: particle systems, animations, dot products, ...
SFML Game Development:

PetruZ

  • Newbie
  • *
  • Posts: 3
    • View Profile
Re: Cannot open included file. Newbie problem!
« Reply #2 on: June 07, 2013, 04:03:34 pm »
I have read it several times, I have entered every directory properly etc. If I do #include <SFML/ >, it even gives me the option to choose "Graphics.hpp" but still it won't compile and gives me the error.

The Hatchet

  • Full Member
  • ***
  • Posts: 135
    • View Profile
    • Email
Re: Cannot open included file. Newbie problem!
« Reply #3 on: June 07, 2013, 09:35:21 pm »
Your answer lies in the setup tutorial.  I've used it many times for different IDE's just fine including VS2010.  When all else fails start a new project and go line by line through the tutorial. 

If you still can't get it post screenshots of your Project Properties.

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32504
    • View Profile
    • SFML's website
    • Email
Re: Cannot open included file. Newbie problem!
« Reply #4 on: June 07, 2013, 09:41:57 pm »
Or upload your project file directly. It's faster to read a simple XML file than asking many questions on the forum ;)
Laurent Gomila - SFML developer

PetruZ

  • Newbie
  • *
  • Posts: 3
    • View Profile
Re: Cannot open included file. Newbie problem!
« Reply #5 on: June 07, 2013, 10:22:25 pm »
Thanks for your help. I found my mistake. When creating the main file, I named it main.cpp instead of just main which made it not work. Fixed and it works now, thank you :)

OniLinkPlus

  • Hero Member
  • *****
  • Posts: 500
    • View Profile
Re: Cannot open included file. Newbie problem!
« Reply #6 on: June 07, 2013, 10:50:28 pm »
What. You're SUPPOSED to name it main.cpp. If changing the filename to just main fixes it, something is seriously wrong.
I use the latest build of SFML2

hayer

  • Jr. Member
  • **
  • Posts: 58
    • View Profile
Re: Cannot open included file. Newbie problem!
« Reply #7 on: June 08, 2013, 03:23:02 pm »
What. You're SUPPOSED to name it main.cpp. If changing the filename to just main fixes it, something is seriously wrong.

Meh, guessing his main got named main.cpp.cpp ?

OniLinkPlus

  • Hero Member
  • *****
  • Posts: 500
    • View Profile
Re: Cannot open included file. Newbie problem!
« Reply #8 on: June 08, 2013, 07:41:47 pm »
What. You're SUPPOSED to name it main.cpp. If changing the filename to just main fixes it, something is seriously wrong.

Meh, guessing his main got named main.cpp.cpp ?
Possibly, he's on Windows so it might be hiding filename extensions.
I use the latest build of SFML2