SFML community forums
Help => General => Topic started by: Makuto 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!
-
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.
-
Drat. Didn't want to do either :(
-
But maybe it's not that. What does "i686-w64-mingw32-gcc -v" outputs?
-
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)
-
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?
-
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?
-
Once you get a compatible gcc 4.7, you should be able to use the pre-compiled release.
-
But nothing has to change with Mingw?
-
What do you mean?
-
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.
-
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)