SFML community forums

Help => Window => Topic started by: zoloproject on October 18, 2008, 11:40:08 pm

Title: App keeps crashing before or while creating the window?
Post by: zoloproject on October 18, 2008, 11:40:08 pm
THis is under VS2008 and windows xP

heres the simple code I'm using
Code: [Select]
#include <SFML/Window.hpp>

int main()
{
sf::Window Window(sf::VideoMode(800, 600, 32), "Simple Window.");

bool running = true;
while (running)
{
sf::Event Event;
while (Window.GetEvent(Event))
{
if (Event.Type == sf::Event::Closed)
running = false;
}

Window.Display();
}

Window.Close();

return (0);
}


The console comes up and then I get an error message saying an unexpected error has occured.
Title: App keeps crashing before or while creating the window?
Post by: quasius on October 19, 2008, 02:30:19 am
Are you linking the correct librarties?  (debug / release?)
Title: App keeps crashing before or while creating the window?
Post by: zoloproject on October 19, 2008, 06:56:29 am
I'm linking these lib's

sfml-system-s.lib
sfml-window-s.lib
sfml-main.lib

I tried with and without main.loib being there and I should note if its not obvious that this is a console app not a win32 project.
Title: App keeps crashing before or while creating the window?
Post by: zoloproject on October 19, 2008, 07:00:50 am
I tried with the debug libs and the window poped up like it should've, Guess I've never used libs/dlls other than the DirectX SDK and its not picky about debug versus retail when compiling with debug runtimes.
Title: App keeps crashing before or while creating the window?
Post by: Laurent on October 19, 2008, 09:09:59 am
You're right, C DLLs are in general mush less picky. But with SFML C++ libraries you have to take care of not mixing debug and release configurations.