Wargus / wargus

Importer and scripts for Warcraft II: Tides of Darkness, the expansion Beyond the Dark Portal, and Aleonas Tales
GNU General Public License v2.0
355 stars 55 forks source link

Wargus 3.1.0 compiling error: no member named 'filesystem' in namespace 'std' #373

Closed AngryPenguinPL closed 3 years ago

AngryPenguinPL commented 3 years ago

Describe the bug When compiling Wargus and War1gus 3.1.0 on OpenMandriva Cooker with Clang 12.0.1 I see this errors.

/usr/include/stratagus-gameutils.h:119:7: error: no member named 'filesystem' in namespace 'std'
DEBUG util.py:636:          std::filesystem::create_directories(path);
DEBUG util.py:636:          ~~~~~^
DEBUG util.py:636:  /usr/include/stratagus-gameutils.h:122:20: error: no member named 'filesystem' in namespace 'std'
DEBUG util.py:636:  void copy_dir(std::filesystem::path source_folder, std::filesystem::path target_folder) {
DEBUG util.py:636:                ~~~~~^
DEBUG util.py:636:  /usr/include/stratagus-gameutils.h:122:57: error: no member named 'filesystem' in namespace 'std'
DEBUG util.py:636:  void copy_dir(std::filesystem::path source_folder, std::filesystem::path target_folder) {
DEBUG util.py:636:                                                     ~~~~~^
DEBUG util.py:636:  /usr/include/stratagus-gameutils.h:123:11: error: no member named 'filesystem' in namespace 'std'
DEBUG util.py:636:          if (std::filesystem::exists(target_folder)) {
DEBUG util.py:636:              ~~~~~^
DEBUG util.py:636:  /usr/include/stratagus-gameutils.h:124:12: error: no member named 'filesystem' in namespace 'std'
DEBUG util.py:636:                  if (std::filesystem::equivalent(source_folder, target_folder)) {
DEBUG util.py:636:                      ~~~~~^
DEBUG util.py:636:  /usr/include/stratagus-gameutils.h:128:8: error: no member named 'filesystem' in namespace 'std'
DEBUG util.py:636:                  std::filesystem::remove_all(target_folder);
DEBUG util.py:636:                  ~~~~~^
DEBUG util.py:636:  /usr/include/stratagus-gameutils.h:131:8: error: no member named 'filesystem' in namespace 'std'
DEBUG util.py:636:                  std::filesystem::create_directories(target_folder.parent_path());
DEBUG util.py:636:                  ~~~~~^
DEBUG util.py:636:  /usr/include/stratagus-gameutils.h:134:7: error: no member named 'filesystem' in namespace 'std'
DEBUG util.py:636:          std::filesystem::copy(source_folder, target_folder, std::filesystem::copy_options::recursive | std::filesystem::copy_options::overwrite_existing);
DEBUG util.py:636:          ~~~~~^
DEBUG util.py:636:  /usr/include/stratagus-gameutils.h:134:59: error: no member named 'filesystem' in namespace 'std'
DEBUG util.py:636:          std::filesystem::copy(source_folder, target_folder, std::filesystem::copy_options::recursive | std::filesystem::copy_options::overwrite_existing);
DEBUG util.py:636:                                                              ~~~~~^
DEBUG util.py:636:  /usr/include/stratagus-gameutils.h:134:102: error: no member named 'filesystem' in namespace 'std'
DEBUG util.py:636:          std::filesystem::copy(source_folder, target_folder, std::filesystem::copy_options::recursive | std::filesystem::copy_options::overwrite_existing);
DEBUG util.py:636:                                                                                                         ~~~~~^
DEBUG util.py:636:  In file included from /builddir/build/BUILD/wargus-3.1.0/wargus.cpp:65:
DEBUG util.py:636:  /usr/include/stratagus-game-launcher.h:279:9: error: no member named 'filesystem' in namespace 'std'
DEBUG util.py:636:                          std::filesystem::path efile_path = std::filesystem::path(destination) / efile;
DEBUG util.py:636:                          ~~~~~^
DEBUG util.py:636:  /usr/include/stratagus-game-launcher.h:279:44: error: no member named 'filesystem' in namespace 'std'
DEBUG util.py:636:                          std::filesystem::path efile_path = std::filesystem::path(destination) / efile;
DEBUG util.py:636:                                                             ~~~~~^
DEBUG util.py:636:  /usr/include/stratagus-game-launcher.h:280:14: error: no member named 'filesystem' in namespace 'std'
DEBUG util.py:636:                          if (!std::filesystem::exists(efile_path)) {
DEBUG util.py:636:                               ~~~~~^
DEBUG util.py:636:  /usr/include/stratagus-game-launcher.h:311:7: error: no member named 'filesystem' in namespace 'std'
DEBUG util.py:636:          std::filesystem::path srcfolder;
DEBUG util.py:636:          ~~~~~^
DEBUG util.py:636:  /usr/include/stratagus-game-launcher.h:335:10: error: no member named 'filesystem' in namespace 'std'
DEBUG util.py:636:                                  std::filesystem::path tmpp = std::filesystem::temp_directory_path() / GAME;
DEBUG util.py:636:                                  ~~~~~^
DEBUG util.py:636:  /usr/include/stratagus-game-launcher.h:335:39: error: no member named 'filesystem' in namespace 'std'
DEBUG util.py:636:                                  std::filesystem::path tmpp = std::filesystem::temp_directory_path() / GAME;
DEBUG util.py:636:                                                               ~~~~~^
DEBUG util.py:636:  /usr/include/stratagus-game-launcher.h:336:10: error: no member named 'filesystem' in namespace 'std'
DEBUG util.py:636:                                  std::filesystem::create_directories(tmpp);
DEBUG util.py:636:                                  ~~~~~^
DEBUG util.py:636:  /usr/include/stratagus-game-launcher.h:384:22: error: no member named 'filesystem' in namespace 'std'
DEBUG util.py:636:                                  srcfolder = std::filesystem::path(datafile).parent_path();
DEBUG util.py:636:                                              ~~~~~^
DEBUG util.py:636:  /usr/include/stratagus-game-launcher.h:387:21: error: no member named 'filesystem' in namespace 'std'
DEBUG util.py:636:                          srcfolder = std::filesystem::path(datafile).parent_path();
DEBUG util.py:636:                                      ~~~~~^
DEBUG util.py:636:  fatal error: too many errors emitted, stopping now [-ferror-limit=]
DEBUG util.py:636:  20 errors generated.
DEBUG util.py:636:  [6/10] Building CXX object CMakeFiles/wartool.dir/xmi2mid.cpp.o
DEBUG util.py:636:  [7/10] Building CXX object CMakeFiles/wartool.dir/wartool.cpp.o
DEBUG util.py:636:  FAILED: CMakeFiles/wartool.dir/wartool.cpp.o 

Full build logs: Wargus: https://file-store.openmandriva.org/api/v1/file_stores/759e5859c600087f1fd2de05638492850df04f82.log?show=true War1gus: https://file-store.openmandriva.org/api/v1/file_stores/82f4bcc32a4d6971adce08aa569ee22ccff3a923.log?show=true

To Reproduce Steps to reproduce the behavior:

  1. Compile strategus 3.1.0 on OpenMandriva Cooker with Clang.
  2. Then try to compile Wargus or War1gus 3.1.0
  3. See error

Desktop (please complete the following information):

timfel commented 3 years ago

There's a check in the cmakelist.txt file for gcc

if (CMAKE_COMPILER_IS_GNUCXX OR CMAKE_COMPILER_IS_GNUC)
    set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++17")
endif()

We only build and test on GCC right now, if you want to build with clang, you have to update that check so we also pass that additional flag when using clang. Pull requests are very welcome :)