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

Author Topic: Having Trouble with SFML  (Read 9442 times)

0 Members and 1 Guest are viewing this topic.

MrBoolean

  • Newbie
  • *
  • Posts: 3
    • View Profile
    • Email
Having Trouble with SFML
« on: June 14, 2013, 01:00:09 am »
Hi everyone I'm new here and I'm having some trouble setting up SFML 2.0 in Visual Studio 2012 Desktop.
I have these errors after trying to write the sample app:

Warning   1   warning C4627: '#include <SFML/Graphics.hpp>': skipped when looking for precompiled header use   c:\users\gigatron\documents\visual studio 2012\projects\sfml basics_1\sfml basics_1\main.cpp   1   1   SFML BASICS_1



Error   2   error C1010: unexpected end of file while looking for precompiled header. Did you forget to add '#include "stdafx.h"' to your source?   c:\users\gigatron\documents\visual studio 2012\projects\sfml basics_1\sfml basics_1\main.cpp   25   1   SFML BASICS_1





   3   IntelliSense: command-line error: invalid macro definition: SFML-STATIC   c:\Users\GigaTron\Documents\Visual Studio 2012\Projects\SFML BASICS_1\SFML BASICS_1\Main.cpp   1   1   SFML BASICS_1



I am pretty much new to C++ so please give as much details for this noob!

The Hatchet

  • Full Member
  • ***
  • Posts: 135
    • View Profile
    • Email
Re: Having Trouble with SFML
« Reply #1 on: June 14, 2013, 01:28:12 am »
#3 should be SFML_STATIC not SFML-STATIC in your Preprocessor Definitions under Project Properties.

Other than that redo the setup tutorial, read EVERY line, even the red boxes.  The tutorial works fine for Visual Studio.  If it's still giving you problems post minimalist complete code and screenshots if you have to.

MrBoolean

  • Newbie
  • *
  • Posts: 3
    • View Profile
    • Email
Re: Having Trouble with SFML
« Reply #2 on: June 14, 2013, 05:37:58 am »
Okay I re-did the tutorial but I only have one error I don't understand:



Error   2   error C1010: unexpected end of file while looking for precompiled header. Did you forget to add '#include "stdafx.h"' to your source?   c:\users\gigatron\documents\visual studio 2012\projects\sfml app1\sfml app1\winmain.cpp   25   1   sfml app1


The Hatchet

  • Full Member
  • ***
  • Posts: 135
    • View Profile
    • Email
Re: Having Trouble with SFML
« Reply #3 on: June 14, 2013, 08:49:58 pm »
Are you building in release or debug mode? 

You could also try marking the 'Not Using Precompiled Headers' in the property pages.  This is under the 'Configuration Properties'->C/C++->'Precompiled Headers'.

Other than that I don't know :/

MrBoolean

  • Newbie
  • *
  • Posts: 3
    • View Profile
    • Email
Re: Having Trouble with SFML
« Reply #4 on: June 14, 2013, 09:29:48 pm »
I was using Debug Mode. Was there something with that option?

The Hatchet

  • Full Member
  • ***
  • Posts: 135
    • View Profile
    • Email
Re: Having Trouble with SFML
« Reply #5 on: June 14, 2013, 09:39:02 pm »
I've just seen people get that error with building projects in Release mode sometimes.  Other than that try turning that Precompiled Headers option off or start from scratch a new project and follow the tutorial line by line.

I know the tutorial is good for getting a VS project in 2010 working(haven't tried 2012), Codeblocks it also works fine if you follow it to a 't' and download the nightly build. 

So if you are following all the tutorials directions it should work, otherwise you may have something configured wrong in your Visual Studio