SFML community forums

Help => General => Topic started by: PetruZ on June 07, 2013, 03:47:18 pm

Title: Cannot open included file. Newbie problem!
Post by: PetruZ 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?
Title: Re: Cannot open included file. Newbie problem!
Post by: Nexus on June 07, 2013, 03:56:17 pm
Please read the tutorial (http://www.sfml-dev.org/tutorials/2.0/start-vc.php) carefully. Everything is explained.
Title: Re: Cannot open included file. Newbie problem!
Post by: PetruZ 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.
Title: Re: Cannot open included file. Newbie problem!
Post by: The Hatchet 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.
Title: Re: Cannot open included file. Newbie problem!
Post by: Laurent 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 ;)
Title: Re: Cannot open included file. Newbie problem!
Post by: PetruZ 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 :)
Title: Re: Cannot open included file. Newbie problem!
Post by: OniLinkPlus 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.
Title: Re: Cannot open included file. Newbie problem!
Post by: hayer 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 ?
Title: Re: Cannot open included file. Newbie problem!
Post by: OniLinkPlus 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.