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

Author Topic: Simple tutorial only displays console window  (Read 3688 times)

0 Members and 1 Guest are viewing this topic.

zerox

  • Newbie
  • *
  • Posts: 3
    • View Profile
Simple tutorial only displays console window
« on: January 29, 2009, 01:19:35 am »
Hello everyone,

I recently took an interest in SFML for a project of mine, however, I am unable to get even the simplest looking tutorials to work.

The first tutorial that is only the console window outputting times with cout runs fine. However, if I try and do:

Code: [Select]
////////////////////////////////////////////////////////////
// Headers
////////////////////////////////////////////////////////////
#include <SFML/Window.hpp>


////////////////////////////////////////////////////////////
/// Entry point of application
///
/// \return Application exit code
///
////////////////////////////////////////////////////////////
int main()
{
    // Create the main window
    sf::Window App(sf::VideoMode(800, 600, 32), "SFML Window");

    // Start main loop
    bool Running = true;
    while (Running)
    {
        App.Display();
    }

    return EXIT_SUCCESS;
}


my program simply hangs in the console window with no output. I can't even seem to debug the code so I can't step through it. I tried adding cout statements at strategic places but it doesn't hit any even if it is the first statement. However, if I put JUST a cout statement in main and comment the rest out it runs fine and displays the output.

In my linker inputs I have:

Code: [Select]
sfml-system-d.lib sfml-graphics-d.lib sfml-window-d.lib

so I don't knwo why it won't even let me debug!

I also have as my pre-processor defines:

Code: [Select]
SFML_DYNAMIC;WIN32;NDEBUG;_CONSOLE

Linker SubSystem to Console and I can't really think of anything else so I'm a little bit frustrated at this point  :oops: .

Any help would be greatly appreicated,

Zerox~

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32498
    • View Profile
    • SFML's website
    • Email
Simple tutorial only displays console window
« Reply #1 on: January 29, 2009, 07:50:16 am »
Do you have a USB joystick connected? If so, you can disconnect it and try again.
Laurent Gomila - SFML developer

zerox

  • Newbie
  • *
  • Posts: 3
    • View Profile
Simple tutorial only displays console window
« Reply #2 on: January 29, 2009, 09:45:46 pm »
How bizzare, I unplugged them and it runs just fine. Displays the window and I can debug fine.

Is there some kind of more permanent workaround for this? And more to the point, what am I going to do about having my game use a joystick XD?

Thanks for your post though, straight to the point =).

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32498
    • View Profile
    • SFML's website
    • Email
Simple tutorial only displays console window
« Reply #3 on: January 29, 2009, 10:32:06 pm »
It's a weird deadlock, which happens when I call Win32 joystick functions during the initialization phase.

I'm going to fix this soon.
Laurent Gomila - SFML developer

zerox

  • Newbie
  • *
  • Posts: 3
    • View Profile
Simple tutorial only displays console window
« Reply #4 on: January 29, 2009, 11:07:24 pm »
Okay then, I will just leave my joypayds unplugged until I hear anything about a fix.

Thanks for taking the time to answer~

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32498
    • View Profile
    • SFML's website
    • Email
Simple tutorial only displays console window
« Reply #5 on: January 30, 2009, 08:06:11 am »
Someone submittted a patch to fix this:
http://orx-project.org/orx/SFML1.4-win32-deadlock.zip

You can use it until the "official" fix.
Laurent Gomila - SFML developer

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32498
    • View Profile
    • SFML's website
    • Email
Simple tutorial only displays console window
« Reply #6 on: January 30, 2009, 03:17:32 pm »
It's now also fixed in the latest SVN revision ;)
Laurent Gomila - SFML developer

 

anything