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

Author Topic: Compiling SFML with MinGW  (Read 1937 times)

0 Members and 1 Guest are viewing this topic.


  • Newbie
  • *
  • Posts: 13
    • View Profile
Compiling SFML with MinGW
« on: August 14, 2017, 02:07:13 am »
I am sorry but I am not sure if this is a problem specific to MinGW, CMake, or SFML but I thought I might try and ask here. I get errors while building SFML using MinGW.

1. ExtractSFML-2.4.2-sources.zip
2. Create build folder
3. cmake -G "MinGW Makefiles" ..
4. mingw-32-make

PS C:\libs\SFML-2.4.2\build> mingw32-make
Scanning dependencies of target sfml-system
[  1%] Building CXX object src/SFML/System/CMakeFiles/sfml-system.dir/Clock.cpp.obj
[  2%] Building CXX object src/SFML/System/CMakeFiles/sfml-system.dir/Err.cpp.obj
[  3%] Building CXX object src/SFML/System/CMakeFiles/sfml-system.dir/Lock.cpp.obj
[  3%] Building CXX object src/SFML/System/CMakeFiles/sfml-system.dir/Mutex.cpp.obj
[  4%] Building CXX object src/SFML/System/CMakeFiles/sfml-system.dir/Sleep.cpp.obj
[  5%] Building CXX object src/SFML/System/CMakeFiles/sfml-system.dir/String.cpp.obj
[  6%] Building CXX object src/SFML/System/CMakeFiles/sfml-system.dir/Thread.cpp.obj
[  7%] Building CXX object src/SFML/System/CMakeFiles/sfml-system.dir/ThreadLocal.cpp.obj
[  8%] Building CXX object src/SFML/System/CMakeFiles/sfml-system.dir/Time.cpp.obj
[  9%] Building CXX object src/SFML/System/CMakeFiles/sfml-system.dir/FileInputStream.cpp.obj
[ 10%] Building CXX object src/SFML/System/CMakeFiles/sfml-system.dir/MemoryInputStream.cpp.obj
[ 11%] Building CXX object src/SFML/System/CMakeFiles/sfml-system.dir/Win32/ClockImpl.cpp.obj
[ 12%] Building CXX object src/SFML/System/CMakeFiles/sfml-system.dir/Win32/MutexImpl.cpp.obj
[ 13%] Building CXX object src/SFML/System/CMakeFiles/sfml-system.dir/Win32/SleepImpl.cpp.obj
[ 14%] Building CXX object src/SFML/System/CMakeFiles/sfml-system.dir/Win32/ThreadImpl.cpp.obj
[ 15%] Building CXX object src/SFML/System/CMakeFiles/sfml-system.dir/Win32/ThreadLocalImpl.cpp.obj
[ 16%] Linking CXX shared library ..\..\..\lib\sfml-system-2.dll
[ 16%] Built target sfml-system
Scanning dependencies of target sfml-main
[ 17%] Building CXX object src/SFML/Main/CMakeFiles/sfml-main.dir/MainWin32.cpp.obj
[ 18%] Linking CXX static library ..\..\..\lib\libsfml-main.a
[ 18%] Built target sfml-main
Scanning dependencies of target sfml-window
[ 19%] Building CXX object src/SFML/Window/CMakeFiles/sfml-window.dir/Context.cpp.obj
[ 20%] Building CXX object src/SFML/Window/CMakeFiles/sfml-window.dir/GlContext.cpp.obj
[ 21%] Building CXX object src/SFML/Window/CMakeFiles/sfml-window.dir/GlResource.cpp.obj
[ 22%] Building CXX object src/SFML/Window/CMakeFiles/sfml-window.dir/Joystick.cpp.obj
In file included from c:\mingw\include\windows.h:48:0,
                 from C:/libs/SFML-2.4.2/src/SFML/Window/Win32/JoystickImpl.hpp:42,
                 from C:/libs/SFML-2.4.2/src/SFML/Window/JoystickImpl.hpp:83,
                 from C:/libs/SFML-2.4.2/src/SFML/Window/JoystickManager.hpp:32,
                 from C:\libs\SFML-2.4.2\src\SFML\Window\Joystick.cpp:29:
c:\mingw\include\winuser.h:3920:47: error: 'PTITLEBARINFO' has not been declared
src\SFML\Window\CMakeFiles\sfml-window.dir\build.make:137: recipe for target 'src/SFML/Window/CMakeFiles/sfml-window.dir
/Joystick.cpp.obj' failed
mingw32-make[2]: *** [src/SFML/Window/CMakeFiles/sfml-window.dir/Joystick.cpp.obj] Error 1
CMakeFiles\Makefile2:227: recipe for target 'src/SFML/Window/CMakeFiles/sfml-window.dir/all' failed
mingw32-make[1]: *** [src/SFML/Window/CMakeFiles/sfml-window.dir/all] Error 2
Makefile:128: recipe for target 'all' failed
mingw32-make: *** [all] Error 2

I have made a Hello World c++ example and that compiled fine, but obviously the problem is inside winuser.h. I don't think this is a SFML bug, I think it is more likely that I setup my MinGW environment incorrectly. I have installed gcc, g++ and mingw32-make on my system, is there another component that needs to be installed? Any help would be appreciated :)


  • Newbie
  • *
  • Posts: 13
    • View Profile
Re: Compiling SFML with MinGW
« Reply #1 on: August 14, 2017, 03:35:06 am »
Well I got past my error. I uninstalled MinGW and installed MinGW-w64. For my purposes I am happy with this solution.