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

Author Topic: Crash when attempting to initialize anything SFML Mingw  (Read 3490 times)

0 Members and 1 Guest are viewing this topic.

Makuto

  • Jr. Member
  • **
  • Posts: 71
    • View Profile
    • Au 79 Games
    • Email
Crash when attempting to initialize anything SFML Mingw
« on: June 17, 2013, 03:25:05 pm »
I've been working on getting a client going with SFML network but I am having a lot of difficulty.

I am compiling with Mingw 32 bits on Ubuntu, using the most recent SFML 2 stable release. I am trying to compile a Windows executable with i686-w64-mingw32-g++.
Here is the code:
http://pastebin.com/RUbRE41D
The crash occurs on line 41, or whenever I initialize an SFML object.
Here is my procedure:
i686-w64-mingw32-g++ -c message.cpp
i686-w64-mingw32-g++ -o messager.exe message.o -lsfml-network -lsfml-graphics -lsfml-window -lsfml-system


It compiles and links without error, but when I execute the .exe with wine, this is my output:
http://pastebin.com/100r5tTN

I've never dealt with "Unhandled Page Fault on Write Access" errors, so what should I do? I have all of the DLLs in the same directory etc. and have tried reinstalling SFML. Also, compiling SFML for Windows in Linux myself is not preferred!
Macoy Madson-Au 79 Games
Check out my work at http://augames.f11.us/
Most of my SFML-related code is here: https://github.com/makuto/personal/tree/master/gameDev/resources/base2.0
I try to KIS(S), do you?

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32498
    • View Profile
    • SFML's website
    • Email
Re: Crash when attempting to initialize anything SFML Mingw
« Reply #1 on: June 17, 2013, 03:43:33 pm »
You should make sure that the SFML release that you downloaded is binary compatible with your MinGW cross-compiler. Small differences, such as a different minor version number, or another threading or exception model, can break compatibility. Recompiling SFML would really be the easiest solution.

You can also run Windows in a virtual machine and do a native build.
Laurent Gomila - SFML developer

Makuto

  • Jr. Member
  • **
  • Posts: 71
    • View Profile
    • Au 79 Games
    • Email
Re: Crash when attempting to initialize anything SFML Mingw
« Reply #2 on: June 17, 2013, 04:08:34 pm »
Drat. Didn't want to do either :(
Macoy Madson-Au 79 Games
Check out my work at http://augames.f11.us/
Most of my SFML-related code is here: https://github.com/makuto/personal/tree/master/gameDev/resources/base2.0
I try to KIS(S), do you?

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32498
    • View Profile
    • SFML's website
    • Email
Re: Crash when attempting to initialize anything SFML Mingw
« Reply #3 on: June 17, 2013, 04:54:18 pm »
But maybe it's not that. What does "i686-w64-mingw32-gcc -v" outputs?
Laurent Gomila - SFML developer

Makuto

  • Jr. Member
  • **
  • Posts: 71
    • View Profile
    • Au 79 Games
    • Email
Re: Crash when attempting to initialize anything SFML Mingw
« Reply #4 on: June 17, 2013, 04:58:59 pm »
Using built-in specs.
COLLECT_GCC=i686-w64-mingw32-gcc
COLLECT_LTO_WRAPPER=/usr/lib/gcc/i686-w64-mingw32/4.6/lto-wrapper
Target: i686-w64-mingw32
Configured with: ../../src/configure --build=x86_64-linux-gnu --prefix=/usr --includedir='/usr/include' --mandir='/usr/share/man' --infodir='/usr/share/info' --sysconfdir=/etc --localstatedir=/var --libexecdir='/usr/lib/gcc-mingw-w64' --disable-maintainer-mode --disable-dependency-tracking --prefix=/usr --enable-shared --enable-static --disable-multilib --enable-linker-build-id --with-system-zlib --libexecdir=/usr/lib --without-included-gettext --libdir=/usr/lib --enable-libstdcxx-time=yes --with-tune=generic --enable-version-specific-runtime-libs --enable-threads=win32 --enable-fully-dynamic-string --enable-sjlj-exceptions --enable-languages=c,c++,fortran,objc,obj-c++,ada --enable-lto --with-plugin-ld --target=i686-w64-mingw32 --with-gxx-include-dir=/usr/include/c++/4.6 --with-as=/usr/bin/i686-w64-mingw32-as --with-ld=/usr/bin/i686-w64-mingw32-ld
Thread model: win32
gcc version 4.6.3 (GCC)
Macoy Madson-Au 79 Games
Check out my work at http://augames.f11.us/
Most of my SFML-related code is here: https://github.com/makuto/personal/tree/master/gameDev/resources/base2.0
I try to KIS(S), do you?

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32498
    • View Profile
    • SFML's website
    • Email
Re: Crash when attempting to initialize anything SFML Mingw
« Reply #5 on: June 17, 2013, 06:29:54 pm »
Too bad it's a 4.6. All SFML releases are compiled with gcc 4.7, and unfortunately the incompatibility happens between 4.6 and 4.7 ;)

Is it the most recent version of the compiler? Isn't there an update available?
Laurent Gomila - SFML developer

Makuto

  • Jr. Member
  • **
  • Posts: 71
    • View Profile
    • Au 79 Games
    • Email
Re: Crash when attempting to initialize anything SFML Mingw
« Reply #6 on: June 17, 2013, 07:34:41 pm »
Looks like GCC 4.7 isn't in the default repository for Ubuntu, but I can get it. Do I need to do anything to Mingw once I do get 4.7 (if I should)?

Or should I just recompile it in Mingw?
« Last Edit: June 17, 2013, 07:38:23 pm by Makuto »
Macoy Madson-Au 79 Games
Check out my work at http://augames.f11.us/
Most of my SFML-related code is here: https://github.com/makuto/personal/tree/master/gameDev/resources/base2.0
I try to KIS(S), do you?

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32498
    • View Profile
    • SFML's website
    • Email
Re: Crash when attempting to initialize anything SFML Mingw
« Reply #7 on: June 17, 2013, 08:05:18 pm »
Once you get a compatible gcc 4.7, you should be able to use the pre-compiled release.
Laurent Gomila - SFML developer

Makuto

  • Jr. Member
  • **
  • Posts: 71
    • View Profile
    • Au 79 Games
    • Email
Re: Crash when attempting to initialize anything SFML Mingw
« Reply #8 on: June 17, 2013, 08:20:42 pm »
But nothing has to change with Mingw?
Macoy Madson-Au 79 Games
Check out my work at http://augames.f11.us/
Most of my SFML-related code is here: https://github.com/makuto/personal/tree/master/gameDev/resources/base2.0
I try to KIS(S), do you?

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32498
    • View Profile
    • SFML's website
    • Email
Re: Crash when attempting to initialize anything SFML Mingw
« Reply #9 on: June 17, 2013, 08:39:36 pm »
What do you mean?
Laurent Gomila - SFML developer

MorleyDev

  • Full Member
  • ***
  • Posts: 219
  • "It is not enough for code to work."
    • View Profile
    • http://www.morleydev.co.uk/
Re: Crash when attempting to initialize anything SFML Mingw
« Reply #10 on: June 17, 2013, 08:43:42 pm »
Mingw is GCC for Windows. If you can't get the GCC 4.7 Mingw version you'll have to recompile SFML using your Mingw version instead. It should still compile, so that won't be a problem.
« Last Edit: June 17, 2013, 08:48:13 pm by MorleyDev »
UnitTest11 - A unit testing library in C++ written to take advantage of C++11.

All code is guilty until proven innocent, unworthy until tested, and pointless without singular and well-defined purpose.

Makuto

  • Jr. Member
  • **
  • Posts: 71
    • View Profile
    • Au 79 Games
    • Email
Re: Crash when attempting to initialize anything SFML Mingw
« Reply #11 on: June 18, 2013, 01:33:04 am »
I ended up compiling on virtual Win 7, which worked fine. Now I just have to wait for Ubuntu to support GCC 4.7 (I'm OK with that)
Macoy Madson-Au 79 Games
Check out my work at http://augames.f11.us/
Most of my SFML-related code is here: https://github.com/makuto/personal/tree/master/gameDev/resources/base2.0
I try to KIS(S), do you?