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

Author Topic: SFML 1.6. and iostream  (Read 2151 times)

0 Members and 1 Guest are viewing this topic.

katrin

  • Newbie
  • *
  • Posts: 17
    • View Profile
SFML 1.6. and iostream
« on: May 25, 2010, 02:20:31 pm »
Hi,

I've searched the forum but either with the wrong key-words or the wrong problem :-). So here is my problem:

I would want to move from SFML 1.4 to 1.6 and experience a problem with the following little program:

Code: [Select]


#include <SFML/System.hpp>
#include <SFML/Graphics.hpp>
#include <SFML/Audio.hpp>
#include <cstdlib>
#include <iostream>

using namespace std;

int main()
{
    cout << "hello world" << endl;

    // Create the main rendering window
    sf::RenderWindow App(sf::VideoMode(800, 600, 32), "SFML Graphics");

    // Start game loop
    while (App.IsOpened())
    {
        // Process events
        sf::Event Event;
        while (App.GetEvent(Event))
        {
            // Close window : exit
            if (Event.Type == sf::Event::Closed)
                App.Close();
        }

        // Clear the screen (fill it with black color)
        App.Clear();

        // Display window contents on screen
        App.Display();
    }


    return EXIT_SUCCESS;

}



Using Code::Blocks 8.02 and static linking with
Mingw gcc4.4 and SFML 1.4 -> everything is fine!
Mingw gcc4.4 and SFML1.6 -> program as is crashes!
What works:
1. If I comment out #include<iostream> and the output-to-console-line

2. If I leave iostream and the output to the console but comment out the window-application loop

Is there any known problem with SFML and iostream?

I appreciate any help!

 

anything