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

Author Topic: Can't compile SFML on Windows 11  (Read 4672 times)

0 Members and 1 Guest are viewing this topic.

Grundkurs

  • Jr. Member
  • **
  • Posts: 52
    • View Profile
Can't compile SFML on Windows 11
« on: October 17, 2021, 07:38:24 pm »
[EDIT]
I could pinpoint the issue: https://winlibs.com/ offers two versions of the mingw-w64 compiler: One ships with UCRT runtime, the other with MSVCRT runtime. With MSVCRT runtime i had no compilation issues. Visual Studio Compiler also had no issues compiling SFML on Windows 11. So i guess its something with the UCRT runtime.
[/EDIT]


I tried to compile SFML on Windows 11 and it fails with the following error-message:

[ 79%] Building CXX object src/SFML/Graphics/CMakeFiles/sfml-graphics.dir/RenderTextureImpl.cpp.obj
[ 79%] Building CXX object src/SFML/Graphics/CMakeFiles/sfml-graphics.dir/RenderTextureImplFBO.cpp.obj
[ 80%] Building CXX object src/SFML/Graphics/CMakeFiles/sfml-graphics.dir/RenderTextureImplDefault.cpp.obj
[ 81%] Building RC object src/SFML/Graphics/CMakeFiles/sfml-graphics.dir/sfml-graphics.rc.obj
[ 82%] Linking CXX shared library ..\..\..\lib\sfml-graphics-2.dll
c:/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/11.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: C:/Users/Keen/Downloads/SFML-master/extlibs/libs-mingw/x64/libfreetype.a(sfnt.c.obj):sfnt.c:(.text+0x5614): undefined reference to `_setjmp'
c:/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/11.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: C:/Users/Keen/Downloads/SFML-master/extlibs/libs-mingw/x64/libfreetype.a(smooth.c.obj):smooth.c:(.text+0x77a): undefined reference to `_setjmp'

collect2.exe: error: ld returned 1 exit status
mingw32-make[2]: *** [src\SFML\Graphics\CMakeFiles\sfml-graphics.dir\build.make:602: lib/sfml-graphics-2.dll] Error 1
mingw32-make[1]: *** [CMakeFiles\Makefile2:307: src/SFML/Graphics/CMakeFiles/sfml-graphics.dir/all] Error 2
mingw32-make: *** [makefile:155: all] Error 2


I did not have this issue on Windows 10 using the same procedure described below:

  • 1. I use mingw-w64 compiler from https://winlibs.com/ (GCC 11.2.0 + LLVM/Clang/LLD/LLDB 13.0.0 + MinGW-w64 9.0.0 - UCRT-Runtime)
  • 2. Download SFML from https://github.com/SFML/SFML
  • 3. generate CMake-Files for MinGW.
  • 4. in Build-Folder: "mingw32-make install"

It compiles until 82 % and than cannot find '_setjmp'.
Compilation of SFML always worked for me in the past, this is the first time that it cannot get through to 100 %. Maybe it has something to do with Win 11?
« Last Edit: October 17, 2021, 10:02:24 pm by Grundkurs »

eXpl0it3r

  • SFML Team
  • Hero Member
  • *****
  • Posts: 10194
    • View Profile
    • development blog
    • Email
Re: Can't compile SFML on Windows 11
« Reply #1 on: October 18, 2021, 10:13:30 am »
There's always a chance that with new OS versions that some libraries need fixes or rebuilds.
As the fix for Ryzen CPU issue are currently only on Insider builds, I'll wait some more weeks for the final release, before updating to Windows 11, then I can take a look.
Official FAQ: https://www.sfml-dev.org/faq.php
Nightly Builds: https://www.nightlybuilds.ch/
——————————————————————
Dev Blog: https://dev.my-gate.net/
Thor: http://www.bromeon.ch/libraries/thor/

Powereleven

  • Newbie
  • *
  • Posts: 34
    • View Profile
Re: Can't compile SFML on Windows 11
« Reply #2 on: November 07, 2021, 08:23:02 am »
I'm on Windows 10 and get the same error

azkalaak

  • Newbie
  • *
  • Posts: 1
    • View Profile
    • Email
Re: Can't compile SFML on Windows 11
« Reply #3 on: March 05, 2022, 10:56:57 am »
I had the same problem (windows 11 using conan to build dependencies and sfml)

However, my problem was due to a mismatch in my conan build, the libfreetype building using g++ and the SFML building using clang++

after purging the sources and using the same compiler and linker to build each dependencies I had no more problems, it does not seem to be a SFML related issue
(it happened when I tried using the sf::Font class)

eXpl0it3r

  • SFML Team
  • Hero Member
  • *****
  • Posts: 10194
    • View Profile
    • development blog
    • Email
Re: Can't compile SFML on Windows 11
« Reply #4 on: March 05, 2022, 12:52:52 pm »
See edit at the top. It's caused by using different runtime libs. SFML's dependencies were compiled with MSVCRT, thus you can mix it with a compiler using UCRT
Official FAQ: https://www.sfml-dev.org/faq.php
Nightly Builds: https://www.nightlybuilds.ch/
——————————————————————
Dev Blog: https://dev.my-gate.net/
Thor: http://www.bromeon.ch/libraries/thor/

 

anything