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

Author Topic: Failed build thor 2.0 with SFML 2.6.1  (Read 269 times)

0 Members and 1 Guest are viewing this topic.

GamDev

  • Newbie
  • *
  • Posts: 29
    • View Profile
Failed build thor 2.0 with SFML 2.6.1
« on: December 03, 2023, 02:37:41 pm »
Hi, I can't compile the library thor 2.0 with SFML 2.6.1
WinLibs MSVCRT 13.1.0 (64-bit)
Build log:
Quote
C:/Users/*****/Desktop/cpp/ide/mingw64/include/c++/13.1.0/bits/uniform_int_dist.h:284:71: error: call to non-'constexpr' function 'static sf::Uint32 thor::{anonymous}::Engine::min()'
  284 |         constexpr __uctype __urngmin = _UniformRandomBitGenerator::min();
      |                                        ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~
C:\Users\*****\Desktop\cpp\lib\thor-v2.0-sdk\src\Random.cpp:79:43: note: 'static sf::Uint32 thor::{anonymous}::Engine::min()' declared here
   79 |                         static sf::Uint32 min()
      |                                           ^~~
C:/Users/*****/Desktop/cpp/ide/mingw64/include/c++/13.1.0/bits/uniform_int_dist.h:285:71: error: call to non-'constexpr' function 'static sf::Uint32 thor::{anonymous}::Engine::max()'
  285 |         constexpr __uctype __urngmax = _UniformRandomBitGenerator::max();
      |                                        ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~
C:\Users\*****\Desktop\cpp\lib\thor-v2.0-sdk\src\Random.cpp:85:43: note: 'static sf::Uint32 thor::{anonymous}::Engine::max()' declared here
   85 |                         static sf::Uint32 max()
      |                                           ^~~
C:/Users/*****/Desktop/cpp/ide/mingw64/include/c++/13.1.0/bits/uniform_int_dist.h:286:34: error: non-constant condition for static assertion
  286 |         static_assert( __urngmin < __urngmax,
      |                        ~~~~~~~~~~^~~~~~~~~~~
mingw32-make.exe[2]: *** [src\CMakeFiles\thor.dir\build.make:361: src/CMakeFiles/thor.dir/Random.cpp.obj] Error 1
mingw32-make.exe[1]: *** [CMakeFiles\Makefile2:97: src/CMakeFiles/thor.dir/all] Error 2
mingw32-make.exe: *** [C:/Users/*****/Desktop/cpp/lib/thor-v2.0-sdk/build/Makefile:135: all] Error 2
mingw32-make.exe[2]: Leaving directory 'C:/Users/*****/Desktop/cpp/lib/thor-v2.0-sdk/build'
mingw32-make.exe[1]: Leaving directory 'C:/Users/*****/Desktop/cpp/lib/thor-v2.0-sdk/build'
Process terminated with status 2 (0 minute(s), 14 second(s))
9 error(s), 6 warning(s) (0 minute(s), 14 second(s))
 

Build Messages:
Quote
||=== Build: all in thor (compiler: GNU GCC Compiler) ===|
C:\Users\*****\Desktop\cpp\ide\mingw64\include\c++\13.1.0\bits\uniform_int_dist.h||In instantiation of 'std::uniform_int_distribution<_IntType>::result_type std::uniform_int_distribution<_IntType>::operator()(_UniformRandomBitGenerator&, const param_type&) [with _UniformRandomBitGenerator = thor::{anonymous}::Engine; _IntType = int; result_type = int]':|
C:\Users\*****\Desktop\cpp\ide\mingw64\include\c++\13.1.0\bits\uniform_int_dist.h|193|required from 'std::uniform_int_distribution<_IntType>::result_type std::uniform_int_distribution<_IntType>::operator()(_UniformRandomBitGenerator&) [with _UniformRandomBitGenerator = thor::{anonymous}::Engine; _IntType = int; result_type = int]'|
C:\Users\*****\Desktop\cpp\lib\thor-v2.0-sdk\src\Random.cpp|114|required from here|
C:\Users\*****\Desktop\cpp\ide\mingw64\include\c++\13.1.0\bits\uniform_int_dist.h|284|error: call to non-'constexpr' function 'static sf::Uint32 thor::{anonymous}::Engine::min()'|
C:\Users\*****\Desktop\cpp\lib\thor-v2.0-sdk\src\Random.cpp|79|note: 'static sf::Uint32 thor::{anonymous}::Engine::min()' declared here|
C:\Users\*****\Desktop\cpp\ide\mingw64\include\c++\13.1.0\bits\uniform_int_dist.h|285|error: call to non-'constexpr' function 'static sf::Uint32 thor::{anonymous}::Engine::max()'|
C:\Users\*****\Desktop\cpp\lib\thor-v2.0-sdk\src\Random.cpp|85|note: 'static sf::Uint32 thor::{anonymous}::Engine::max()' declared here|
C:\Users\*****\Desktop\cpp\ide\mingw64\include\c++\13.1.0\bits\uniform_int_dist.h|286|error: non-constant condition for static assertion|
C:\Users\*****\Desktop\cpp\ide\mingw64\include\c++\13.1.0\bits\uniform_int_dist.h||In instantiation of 'std::uniform_int_distribution<_IntType>::result_type std::uniform_int_distribution<_IntType>::operator()(_UniformRandomBitGenerator&, const param_type&) [with _UniformRandomBitGenerator = thor::{anonymous}::Engine; _IntType = unsigned int; result_type = unsigned int]':|
C:\Users\*****\Desktop\cpp\ide\mingw64\include\c++\13.1.0\bits\uniform_int_dist.h|193|required from 'std::uniform_int_distribution<_IntType>::result_type std::uniform_int_distribution<_IntType>::operator()(_UniformRandomBitGenerator&) [with _UniformRandomBitGenerator = thor::{anonymous}::Engine; _IntType = unsigned int; result_type = unsigned int]'|
C:\Users\*****\Desktop\cpp\lib\thor-v2.0-sdk\src\Random.cpp|121|required from here|
C:\Users\*****\Desktop\cpp\ide\mingw64\include\c++\13.1.0\bits\uniform_int_dist.h|284|error: call to non-'constexpr' function 'static sf::Uint32 thor::{anonymous}::Engine::min()'|
C:\Users\*****\Desktop\cpp\lib\thor-v2.0-sdk\src\Random.cpp|79|note: 'static sf::Uint32 thor::{anonymous}::Engine::min()' declared here|
C:\Users\*****\Desktop\cpp\ide\mingw64\include\c++\13.1.0\bits\uniform_int_dist.h|285|error: call to non-'constexpr' function 'static sf::Uint32 thor::{anonymous}::Engine::max()'|
C:\Users\*****\Desktop\cpp\lib\thor-v2.0-sdk\src\Random.cpp|85|note: 'static sf::Uint32 thor::{anonymous}::Engine::max()' declared here|
C:\Users\*****\Desktop\cpp\ide\mingw64\include\c++\13.1.0\bits\uniform_int_dist.h|286|error: non-constant condition for static assertion|
 [src\CMakeFiles\thor.dir\build.make|361|src/CMakeFiles/thor.dir/Random.cpp.obj] Error 1|
 [CMakeFiles\Makefile2|97|src/CMakeFiles/thor.dir/all] Error 2|
 [C:\Users\*****\Desktop\cpp\lib\thor-v2.0-sdk\build\Makefile|135|all] Error 2|
||=== Build failed: 9 error(s), 6 warning(s) (0 minute(s), 14 second(s)) ===|
« Last Edit: December 03, 2023, 02:39:26 pm by GamDev »

eXpl0it3r

  • SFML Team
  • Hero Member
  • *****
  • Posts: 10815
    • View Profile
    • development blog
    • Email
Re: Failed build thor 2.0 with SFML 2.6.1
« Reply #1 on: December 05, 2023, 11:29:31 am »
Sounds like the specific implementation for the <random> header changed and it's expecting now a constexpr function for min() and max(), but Thor only sees to provide a static method.

The fix would either be to downgrade the C++ standard you're using or update Thor yourself.
Official FAQ: https://www.sfml-dev.org/faq.php
Official Discord Server: https://discord.gg/nr4X7Fh
——————————————————————
Dev Blog: https://duerrenberger.dev/blog/

GamDev

  • Newbie
  • *
  • Posts: 29
    • View Profile
Re: Failed build thor 2.0 with SFML 2.6.1
« Reply #2 on: December 10, 2023, 10:40:14 am »
-std=c++0x add to compiler
error still remains