shiiion / Ishiiruka

GNU General Public License v2.0
47 stars 6 forks source link

Compile error on ArchLinux at FpsControls.cpp.o also after ad3d542 #15

Open Linskun opened 3 years ago

Linskun commented 3 years ago

New compile error with the new commit ad3d542

Here the last log :

/home/user/Games/primehack-ishiiruka/Source/Core/Core/PrimeHack/Mods/FpsControls.cpp:265:80: warning: suggest parentheses around ‘&&’ within ‘||’ [-Wparentheses]
  265 |   bool locked = (read32(mp1_static.orbit_state_address) != ORBIT_STATE_GRAPPLE &&
      |                  ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~
  266 |     read8(mp1_static.lockon_address) || beamvisor_menu);
      |     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/home/user/Games/primehack-ishiiruka/Source/Core/Core/PrimeHack/Mods/FpsControls.cpp: In member function ‘void prime::FpsControls::run_mod_mp2(prime::Region)’:
/home/user/Games/primehack-ishiiruka/Source/Core/Core/PrimeHack/Mods/FpsControls.cpp:383:73: warning: suggest parentheses around ‘&&’ within ‘||’ [-Wparentheses]
  383 |   bool locked = (read32(cplayer_address + 0x390) != ORBIT_STATE_GRAPPLE &&
      |                  ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~
  384 |     read32(mp2_static.lockon_address) || beamvisor_menu);
      |     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/home/user/Games/primehack-ishiiruka/Source/Core/Core/PrimeHack/Mods/FpsControls.cpp: In member function ‘void prime::FpsControls::run_mod_mp3(prime::Game, prime::Region)’:
/home/user/Games/primehack-ishiiruka/Source/Core/Core/PrimeHack/Mods/FpsControls.cpp:566:39: warning: suggest parentheses around ‘&&’ within ‘||’ [-Wparentheses]
  566 |   if (!read8(cplayer_address + 0x378) && read8(mp3_static.lockon_address) || beamvisor_menu || read8(cplayer_address + 0x378)) {
      |       ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/home/user/Games/primehack-ishiiruka/Source/Core/Core/PrimeHack/Mods/FpsControls.cpp:630:18: error: ‘lerp’ is not a member of ‘std’
  630 |     pitch = std::lerp(start_pitch, 0.f, delta / 15.f);
      |                  ^~~~
make[2]: *** [Source/Core/Core/CMakeFiles/core.dir/build.make:3059: Source/Core/Core/CMakeFiles/core.dir/PrimeHack/Mods/FpsControls.cpp.o] Error 1
make[1]: *** [CMakeFiles/Makefile2:1148: Source/Core/Core/CMakeFiles/core.dir/all] Error 2
make: *** [Makefile:171: all] Error 2

primehack-ishiiruka_compile_error_2.log

Software information OS: Arch Linux x86_64 Resolution: 1920x1080 Dm/Wm: GNOME gcc (GCC) 10.2.0

System information

SirMangler commented 3 years ago

std::lerp, I was worried that might not compile on Linux. Luckily cmath seems to contain lerp for Linux. This commit should fix the other problems too, https://github.com/shiiion/Ishiiruka/commit/81b9fcf39b515c6aa2b55f91d78fba44c9bc4a03

Linskun commented 3 years ago

Tried but i have the same

/home/user/Games/primehack-ishiiruka/Source/Core/Core/PrimeHack/Mods/FpsControls.cpp:631:18: error: ‘lerp’ is not a member of ‘std’
  631 |     pitch = std::lerp(start_pitch, 0.f, delta / 15.f);
      |                  ^~~~
make[2]: *** [Source/Core/Core/CMakeFiles/core.dir/build.make:3059: Source/Core/Core/CMakeFiles/core.dir/PrimeHack/Mods/FpsControls.cpp.o] Error 1
make[1]: *** [CMakeFiles/Makefile2:1148: Source/Core/Core/CMakeFiles/core.dir/all] Error 2
make: *** [Makefile:171: all] Error 2
SirMangler commented 3 years ago

You may need to compile with a later version of C++. std::lerp was only added in C++20. I'll look into this more later, there may be a built in function for it in Dolphin like there is for Qt.

Linskun commented 3 years ago

Tried with clang++ but it stop immediately with error

[user@Arch Build]$ make
Scanning dependencies of target bdisasm
[  0%] Building CXX object Externals/Bochs_disasm/CMakeFiles/bdisasm.dir/dis_decode.cc.o
[  0%] Building CXX object Externals/Bochs_disasm/CMakeFiles/bdisasm.dir/dis_groups.cc.o
[  1%] Building CXX object Externals/Bochs_disasm/CMakeFiles/bdisasm.dir/resolve.cc.o
[  1%] Building CXX object Externals/Bochs_disasm/CMakeFiles/bdisasm.dir/syntax.cc.o
[  1%] Linking CXX static library libbdisasm.a
[  1%] Built target bdisasm
Scanning dependencies of target glslang
[  1%] Building CXX object Externals/glslang/CMakeFiles/glslang.dir/glslang/GenericCodeGen/CodeGen.cpp.o
In file included from /home/user/Games/primehack-ishiiruka/Externals/glslang/glslang/GenericCodeGen/CodeGen.cpp:35:
In file included from /home/user/Games/primehack-ishiiruka/Externals/glslang/glslang/GenericCodeGen/../Include/Common.h:95:
/home/user/Games/primehack-ishiiruka/Externals/glslang/glslang/GenericCodeGen/../Include/PoolAlloc.h:315:54: error: 'operator=' is a private member of 'glslang::TPoolAllocator'
    void setAllocator(TPoolAllocator* a) { allocator = *a; }
                                           ~~~~~~~~~ ^ ~~
/home/user/Games/primehack-ishiiruka/Externals/glslang/glslang/GenericCodeGen/../Include/PoolAlloc.h:244:21: note: declared private here
    TPoolAllocator& operator=(const TPoolAllocator&);  // don't allow assignment operator
                    ^
1 error generated.
make[2]: *** [Externals/glslang/CMakeFiles/glslang.dir/build.make:82: Externals/glslang/CMakeFiles/glslang.dir/glslang/GenericCodeGen/CodeGen.cpp.o] Error 1
make[1]: *** [CMakeFiles/Makefile2:742: Externals/glslang/CMakeFiles/glslang.dir/all] Error 2
make: *** [Makefile:171: all] Error 2

I found this issue on Dolphin-emu bugtracker : Emulator Issues #12032

SirMangler commented 3 years ago

Trouble is, this is the PrimeHack-Ishiiruka repository, Ishiiruka is a fork of dolphin which is pretty old by a few years. You'd have to talk to the maintainers for Ishiiruka about stuff not relevant to PrimeHack.

Have you ensured you're compiling with C++20?

SirMangler commented 3 years ago

This should resolve the problem: https://github.com/shiiion/Ishiiruka/commit/2a67e9e58606c57ee23b5c409464c6130cd090fc

Linskun commented 3 years ago

Happy new Year !

I'm using the latest version of GCC & CLANG I've checked on CMakeLists.txt and found that it check for CXX17 and pass -std=c++17. For C++20 shouldn't it check the CXX20 support and pass -std=c++20 parameter ?

Ok now i don't have anymore problem on FPSControl.cpp.o but it give me another error :

/home/user/Games/primehack-ishiiruka/Source/Core/Core/PrimeHack/Mods/ElfModLoader.cpp:89:10: warning: enumeration value ‘MENU’ not handled in switch [-Wswitch]
/home/user/Games/primehack-ishiiruka/Source/Core/Core/PrimeHack/Mods/ElfModLoader.cpp:89:10: warning: enumeration value ‘MENU_PRIME_1’ not handled in switch [-Wswitch]
/home/user/Games/primehack-ishiiruka/Source/Core/Core/PrimeHack/Mods/ElfModLoader.cpp:89:10: warning: enumeration value ‘MENU_PRIME_2’ not handled in switch [-Wswitch]
/home/user/Games/primehack-ishiiruka/Source/Core/Core/PrimeHack/Mods/ElfModLoader.cpp:89:10: warning: enumeration value ‘PRIME_1’ not handled in switch [-Wswitch]
/home/user/Games/primehack-ishiiruka/Source/Core/Core/PrimeHack/Mods/ElfModLoader.cpp:89:10: warning: enumeration value ‘PRIME_2’ not handled in switch [-Wswitch]
/home/user/Games/primehack-ishiiruka/Source/Core/Core/PrimeHack/Mods/ElfModLoader.cpp:89:10: warning: enumeration value ‘PRIME_3’ not handled in switch [-Wswitch]
/home/user/Games/primehack-ishiiruka/Source/Core/Core/PrimeHack/Mods/ElfModLoader.cpp:89:10: warning: enumeration value ‘PRIME_3_STANDALONE’ not handled in switch [-Wswitch]
/home/user/Games/primehack-ishiiruka/Source/Core/Core/PrimeHack/Mods/ElfModLoader.cpp:89:10: warning: enumeration value ‘PRIME_2_GCN’ not handled in switch [-Wswitch]
/home/user/Games/primehack-ishiiruka/Source/Core/Core/PrimeHack/Mods/ElfModLoader.cpp:89:10: warning: enumeration value ‘MAX_VAL’ not handled in switch [-Wswitch]
/home/user/Games/primehack-ishiiruka/Source/Core/Core/PrimeHack/Mods/ElfModLoader.cpp: In member function ‘std::optional<std::__cxx11::basic_string<char> > prime::ElfModLoader::parse_elfpath(const string&, const string&)’:
/home/user/Games/primehack-ishiiruka/Source/Core/Core/PrimeHack/Mods/ElfModLoader.cpp:191:42: error: conversion from ‘basic_string<char>’ to non-scalar type ‘basic_string<wchar_t>’ requested
  191 |     std::wstring tmp = search_name.native();
      |                        ~~~~~~~~~~~~~~~~~~^~
make[2]: *** [Source/Core/Core/CMakeFiles/core.dir/build.make:3124: Source/Core/Core/CMakeFiles/core.dir/PrimeHack/Mods/ElfModLoader.cpp.o] Error 1
make[1]: *** [CMakeFiles/Makefile2:1148: Source/Core/Core/CMakeFiles/core.dir/all] Error 2
make: *** [Makefile:171: all] Error 2
Linskun commented 3 years ago

Another info that i forgot to report : i use GCC 10.2 that is the latest version on Linux. The G++20 std::lerp was introduced with GCC9 so i'm full compliant with it (see the changelog here ) So i think that the CMakeFile don't pass the correct flag for C++20 when compiler different that MSVC is found

thejacer87 commented 3 years ago

Happy new Year !

I'm using the latest version of GCC & CLANG I've checked on CMakeLists.txt and found that it check for CXX17 and pass -std=c++17. For C++20 shouldn't it check the CXX20 support and pass -std=c++20 parameter ?

Ok now i don't have anymore problem on FPSControl.cpp.o but it give me another error :

/home/user/Games/primehack-ishiiruka/Source/Core/Core/PrimeHack/Mods/ElfModLoader.cpp:89:10: warning: enumeration value ‘MENU’ not handled in switch [-Wswitch]
/home/user/Games/primehack-ishiiruka/Source/Core/Core/PrimeHack/Mods/ElfModLoader.cpp:89:10: warning: enumeration value ‘MENU_PRIME_1’ not handled in switch [-Wswitch]
/home/user/Games/primehack-ishiiruka/Source/Core/Core/PrimeHack/Mods/ElfModLoader.cpp:89:10: warning: enumeration value ‘MENU_PRIME_2’ not handled in switch [-Wswitch]
/home/user/Games/primehack-ishiiruka/Source/Core/Core/PrimeHack/Mods/ElfModLoader.cpp:89:10: warning: enumeration value ‘PRIME_1’ not handled in switch [-Wswitch]
/home/user/Games/primehack-ishiiruka/Source/Core/Core/PrimeHack/Mods/ElfModLoader.cpp:89:10: warning: enumeration value ‘PRIME_2’ not handled in switch [-Wswitch]
/home/user/Games/primehack-ishiiruka/Source/Core/Core/PrimeHack/Mods/ElfModLoader.cpp:89:10: warning: enumeration value ‘PRIME_3’ not handled in switch [-Wswitch]
/home/user/Games/primehack-ishiiruka/Source/Core/Core/PrimeHack/Mods/ElfModLoader.cpp:89:10: warning: enumeration value ‘PRIME_3_STANDALONE’ not handled in switch [-Wswitch]
/home/user/Games/primehack-ishiiruka/Source/Core/Core/PrimeHack/Mods/ElfModLoader.cpp:89:10: warning: enumeration value ‘PRIME_2_GCN’ not handled in switch [-Wswitch]
/home/user/Games/primehack-ishiiruka/Source/Core/Core/PrimeHack/Mods/ElfModLoader.cpp:89:10: warning: enumeration value ‘MAX_VAL’ not handled in switch [-Wswitch]
/home/user/Games/primehack-ishiiruka/Source/Core/Core/PrimeHack/Mods/ElfModLoader.cpp: In member function ‘std::optional<std::__cxx11::basic_string<char> > prime::ElfModLoader::parse_elfpath(const string&, const string&)’:
/home/user/Games/primehack-ishiiruka/Source/Core/Core/PrimeHack/Mods/ElfModLoader.cpp:191:42: error: conversion from ‘basic_string<char>’ to non-scalar type ‘basic_string<wchar_t>’ requested
  191 |     std::wstring tmp = search_name.native();
      |                        ~~~~~~~~~~~~~~~~~~^~
make[2]: *** [Source/Core/Core/CMakeFiles/core.dir/build.make:3124: Source/Core/Core/CMakeFiles/core.dir/PrimeHack/Mods/ElfModLoader.cpp.o] Error 1
make[1]: *** [CMakeFiles/Makefile2:1148: Source/Core/Core/CMakeFiles/core.dir/all] Error 2
make: *** [Makefile:171: all] Error 2

im getting the same error here on manjaro linux