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

Author Topic: Tutorial - Getting started - SFML and Visual Studio  (Read 3028 times)

0 Members and 3 Guests are viewing this topic.

Cowdog

  • Newbie
  • *
  • Posts: 1
    • View Profile
Tutorial - Getting started - SFML and Visual Studio
« on: April 20, 2011, 03:55:14 am »
So I followed the getting started tutorial and when compiling I get this:

1>------ Build started: Project: First_SFML, Configuration: Debug Win32 ------
1>Compiling...
1>First_SFML.cpp
1>c:\users\sean\documents\visual studio 2008\projects\first_sfml\first_sfml\first_sfml.cpp(1) : warning C4627: '#include <SFML/System.hpp>': skipped when looking for precompiled header use
1>        Add directive to 'stdafx.h' or rebuild precompiled header
1>c:\users\sean\documents\visual studio 2008\projects\first_sfml\first_sfml\first_sfml.cpp(2) : warning C4627: '#include <iostream>': skipped when looking for precompiled header use
1>        Add directive to 'stdafx.h' or rebuild precompiled header
1>c:\users\sean\documents\visual studio 2008\projects\first_sfml\first_sfml\first_sfml.cpp(15) : fatal error C1010: unexpected end of file while looking for precompiled header. Did you forget to add '#include "stdafx.h"' to your source?
1>Build log was saved at "file://c:\Users\Sean\Documents\Visual Studio 2008\Projects\First_SFML\First_SFML\Debug\BuildLog.htm"
1>First_SFML - 1 error(s), 2 warning(s)
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========

There was something in the tutorial I didn't quite understand such as, "This is for the dynamic version of the libraries, the one using the DLLs. If you want to link with the static version of the libraries, add the "-s" suffix : sfml-system-s.lib, or sfml-system-s-d.lib for the debug version." I did not do this. Is this a problem?

Here is the link to the tutorial: http://www.sfml-dev.org/tutorials/1.6/start-vc.php
FYI, I am using Visual C++ 2008 Express Edition.

Thanks,
Cowdog

krisando

  • Newbie
  • *
  • Posts: 20
    • View Profile
Tutorial - Getting started - SFML and Visual Studio
« Reply #1 on: April 20, 2011, 05:16:47 am »
Did you remember to define SFML_STATIC?

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32504
    • View Profile
    • SFML's website
    • Email
Tutorial - Getting started - SFML and Visual Studio
« Reply #2 on: April 20, 2011, 07:30:12 am »
Look at the error, it contains relevant information:
Quote
fatal error C1010: unexpected end of file while looking for precompiled header. Did you forget to add '#include "stdafx.h"' to your source?

This has nothing to do with SFML, you chose to generate a precompiled header in your project settings, but you're not using it. You should just disable it.
Laurent Gomila - SFML developer

 

anything