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

Author Topic: MinGW 4.8 compiled apps crash  (Read 3185 times)

0 Members and 1 Guest are viewing this topic.

dobbi10k

  • Newbie
  • *
  • Posts: 14
    • View Profile
MinGW 4.8 compiled apps crash
« on: May 06, 2012, 03:40:10 pm »
Hey Laurent,

as you suggested I'm now opening a thread for every compiler that doesn't work. The first one is MinGW32 4.8 from mingw-builds. The apps do in fact compile, but fail to run properly. This minimal example:
Code: [Select]
#include <SFML/Graphics.hpp>

int main()
{
    bool Running = true;
    sf::RenderWindow Window;
    Window.create(sf::VideoMode(640, 480, 32), "SFML 2 Test");
    while (Running)
    {
        sf::Event tmpEvent;
        while (Window.pollEvent(tmpEvent))
        {
            if (tmpEvent.type == sf::Event::Closed) Running = false;
        }
        Window.clear(sf::Color::Red);
        Window.display();
    }
    Window.close();
    return 0;
}

exits with 0xC0000005.

Call stack:
#0 0046C093   sf::ContextSettings::ContextSettings(this=0x76f52b62, depth=2685440, stencil=0, antialiasing=0, major=0, minor=2) (C:/Users/d10k/Documents/SFML/SFML-2.0rc-sjlj/include/SFML/Window/ContextSettings.hpp:53)
#1 00461D2E   sf::priv::WglContext::WglContext(this=0x7829f0, shared=0x0) (D:\developpement\sfml-master\src\SFML\Window\Win32\WglContext.cpp:58)
#2 0045E4E7   sf::priv::GlContext::globalInit() (D:\developpement\sfml-master\src\SFML\Window\GlContext.cpp:105)
#3 0045D350   sf::GlResource::GlResource(this=0x28fc4c) (D:\developpement\sfml-master\src\SFML\Window\GlResource.cpp:53)
#4 0045C21B   sf::Window::Window(this=0x28fc4c) (D:\developpement\sfml-master\src\SFML\Window\Window.cpp:47)
#5 00401E6F   sf::RenderWindow::RenderWindow(this=0x28fc4c) (D:\developpement\sfml-master\src\SFML\Graphics\RenderWindow.cpp:35)
#6 004015BF   main() (C:\Users\d10k\Documents\CPP-Projects\SFML2 Testing\main.cpp:6)

When I change
Code: [Select]
sf::RenderWindow Window;
Window.create(sf::VideoMode(640, 480, 32), "SFML 2 Test");
to
Code: [Select]
sf::RenderWindow Window(sf::VideoMode(640, 480, 32), "SFML 2 Test");
the call stack is:
#0 0045BE91   sf::VideoMode::VideoMode(this=0x280, modeWidth=480, modeHeight=32, modeBitsPerPixel=2) (D:\developpement\sfml-master\src\SFML\Window\VideoMode.cpp:50)
#1 00401636   main() (C:\Users\d10k\Documents\CPP-Projects\SFML2 Testing\main.cpp:6)

I hope this helps to possibly fix the problem.
Note: Compiling SFML 2 fails, too, due to some missing libraries. I'm going to try to get it to compile and see if the apps run fine with that version. Unfortunately I have hardly any time for programming at the moment though, which is why this could take a few days :(

Regards,
dobbi10k

P.S.:spelling mistakes are most likely caused by Win8's malfunctioning spell-check function.

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32498
    • View Profile
    • SFML's website
    • Email
Re: MinGW 4.8 compiled apps crash
« Reply #1 on: May 06, 2012, 03:51:17 pm »
First, it seems like there's no stable release of this version, there are only development snapshots. So are they even supposed to work?

Second, and that's likely to be causing the crash, this version uses a POSIX thread model, whereas SFML 2.0 RC is compiled with a GCC that is using Win32 for threads.

Don't forget that gcc builds on Windows are all different, and you can only use libraries that were compiled with a compatible (= the same) version. So once you manage to compile SFML, it should work.

By the way, what are those missing libraries?
Laurent Gomila - SFML developer

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32498
    • View Profile
    • SFML's website
    • Email
Re: MinGW 4.8 compiled apps crash
« Reply #2 on: May 06, 2012, 03:56:19 pm »
And it would be cool if you could edit your other post. It can be misleading.
Laurent Gomila - SFML developer

dobbi10k

  • Newbie
  • *
  • Posts: 14
    • View Profile
Re: MinGW 4.8 compiled apps crash
« Reply #3 on: May 06, 2012, 04:44:23 pm »
Concerning the development snapshots: I guess they should work, I've never had any problems with this compiler and the 4.7 version, which is stable, works neither. As 4.8 works on Linux I guess it's not the original code, it's either the bad porting or mixed versions.
I'll edit the other post and list all the missing libraries ASAP (on my mobile right now).

dobbi10k

  • Newbie
  • *
  • Posts: 14
    • View Profile
Re: MinGW 4.8 compiled apps crash
« Reply #4 on: May 06, 2012, 05:04:34 pm »
Turns out the lates build of 4.8 is able to compile SFML. Anyway, the linking step takes forever now and I'm getting those 'undefined reference to __unwind_resume' errors that usually occur when mixing SJLJ and DW2, which is definitely not the case here, because I compiled SFML and my app with the same Version of MinGW. I guess I'll just Abandon MinGW, create binaries for Windows with VC++ and use the standard gcc on Linux...

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32498
    • View Profile
    • SFML's website
    • Email
Re: MinGW 4.8 compiled apps crash
« Reply #5 on: May 06, 2012, 05:32:33 pm »
I succeeded to compile and run SFML and its examples with i686-mingw32-gcc-4.8.0-snapshot-20120506-rev-187198-c,c++,fortran.

So you must be doing something wrong (have you tried to compile SFML examples?).

I've deleted your other thread, because now it's clear that your problem cannot be generalized.
Laurent Gomila - SFML developer

 

anything