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

Author Topic: [SOLVED] SFML 2.0 Compiling Woes  (Read 2060 times)

0 Members and 1 Guest are viewing this topic.

Roswell_r

  • Newbie
  • *
  • Posts: 12
    • View Profile
[SOLVED] SFML 2.0 Compiling Woes
« on: April 01, 2011, 02:18:26 am »
I've been a user of 1.6 for a while now but I decided to try out 2.0 and having difficulty with compiling and even running a basic application.

Firstly I have no issues with running nmake and generating vs2008 solution files and also copiling the libraries to static. I also know I need to include the SFML_STATIC pre def if I want to compile with my project.

So once I compiled the libs I started a new empty console project (as usual) and setup the pre def and added the libs to the linker, created a simple blank screen render app and compiled, no probs. Then when I run it, I get a crash on App.Clear(); it is as though its having trouble getting opengl context perhaps???

What can I do to further debug my problem? heres the code for the simple app, maybe im missing something.

Code: [Select]
//
//
//

#include "SFML/Graphics.hpp"

int main()
{
sf::RenderWindow App(sf::VideoMode::GetDesktopMode(), "Test");


sf::Event e;

while(App.IsOpened())
{

while(App.GetEvent(e))
{
}

App.Clear();

App.Display();
}

}


btw im running win7 32bit

Solved: Was using incorrect headers, had previously downloaded 2.0 before but headers must of changed since new source downloaded yesterday.

JAssange

  • Full Member
  • ***
  • Posts: 104
    • View Profile
[SOLVED] SFML 2.0 Compiling Woes
« Reply #1 on: April 01, 2011, 02:49:53 am »
I believe it is because you forgot to show your window. (Maybe it isn't required but I always call .Show() after creating one.)

meissner61

  • Newbie
  • *
  • Posts: 26
    • View Profile
    • Email
[SOLVED] SFML 2.0 Compiling Woes
« Reply #2 on: April 01, 2011, 08:30:01 am »
Hey maybe you can explain how you compiled SFML 2? There are some video tutorials on how to do it but are the steps still the same since he changed from SVN to GIT?

Roswell_r

  • Newbie
  • *
  • Posts: 12
    • View Profile
[SOLVED] SFML 2.0 Compiling Woes
« Reply #3 on: April 01, 2011, 12:31:39 pm »
I just downloaded the 2.0 snapshot from the download section and followed this tutorial: http://www.sfml-dev.org/tutorials/2.0/compile-with-cmake.php

When you create your project if you want to staticlly link to SFML you need to include the Preprocessor Definition SFML_STATIC.

That is pretty much it.

 

anything