fuzziqersoftware / resource_dasm

Classic Mac OS resource fork and application disassembler, with reverse-engineering tools for specific applications
MIT License
114 stars 13 forks source link

compile error in Ubuntu on Pi4 ARM #53

Closed PalasX closed 2 years ago

PalasX commented 2 years ago
[ 12%] Building CXX object CMakeFiles/resource_file.dir/src/Emulators/MemoryContext.cc.o
/home/pi/programs/resource_dasm/src/Emulators/MemoryContext.cc: In member function ‘std::__cxx11::string MemoryContext::Arena::str() const’:
/home/pi/programs/resource_dasm/src/Emulators/MemoryContext.cc:193:30: error: format ‘%lX’ expects argument of type ‘long unsigned int’, but argument 3 has type ‘unsigned int’ [-Werror=format=]
   string ret = string_printf("[Arena %08" PRIX32 "-%08lX at %p alloc=%zX free=%zX alloc_blocks=[",
                              ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/home/pi/programs/resource_dasm/src/Emulators/MemoryContext.cc:195:7:
       this->addr + this->size,
       ~~~~~~~~~~~~~~~~~~~~~~~
cc1plus: all warnings being treated as errors
make[2]: *** [CMakeFiles/resource_file.dir/build.make:206: CMakeFiles/resource_file.dir/src/Emulators/MemoryContext.cc.o] Error 1
make[1]: *** [CMakeFiles/Makefile2:224: CMakeFiles/resource_file.dir/all] Error 2
make: *** [Makefile:130: all] Error 2

changing the source line to the following seems to allow it to compile OK (take out the L from %08lX): string ret = string_printf("[Arena %08" PRIX32 "-%08X at %p alloc=%zX free=%zX alloc_blocks=[",

PalasX commented 2 years ago

next compile error is:

[  2%] Building CXX object CMakeFiles/resource_file.dir/src/Emulators/PPC32Emulator.cc.o
/home/pi/programs/resource_dasm/src/Emulators/PPC32Emulator.cc: In member function ‘uint32_t PPC32Emulator::Assembler::asm_bc_mnemonic(const PPC32Emulator::Assembler::StreamItem&)’:
/home/pi/programs/resource_dasm/src/Emulators/PPC32Emulator.cc:1065:16: error: ‘std::__cxx11::string’ {aka ‘class std::__cxx11::basic_string<char>’} has no member named ‘ends_with’
   if (mnemonic.ends_with("a")) {
                ^~~~~~~~~
/home/pi/programs/resource_dasm/src/Emulators/PPC32Emulator.cc:1069:16: error: ‘std::__cxx11::string’ {aka ‘class std::__cxx11::basic_string<char>’} has no member named ‘ends_with’
   if (mnemonic.ends_with("l")) {
                ^~~~~~~~~
/home/pi/programs/resource_dasm/src/Emulators/PPC32Emulator.cc: In member function ‘uint32_t PPC32Emulator::Assembler::asm_b_mnemonic(const PPC32Emulator::Assembler::StreamItem&)’:
/home/pi/programs/resource_dasm/src/Emulators/PPC32Emulator.cc:1180:16: error: ‘std::__cxx11::string’ {aka ‘class std::__cxx11::basic_string<char>’} has no member named ‘ends_with’
   if (mnemonic.ends_with("a")) {
                ^~~~~~~~~
/home/pi/programs/resource_dasm/src/Emulators/PPC32Emulator.cc:1184:16: error: ‘std::__cxx11::string’ {aka ‘class std::__cxx11::basic_string<char>’} has no member named ‘ends_with’
   if (mnemonic.ends_with("l")) {
                ^~~~~~~~~
/home/pi/programs/resource_dasm/src/Emulators/PPC32Emulator.cc: In member function ‘uint32_t PPC32Emulator::Assembler::asm_bclr_mnemonic(const PPC32Emulator::Assembler::StreamItem&)’:
/home/pi/programs/resource_dasm/src/Emulators/PPC32Emulator.cc:1355:16: error: ‘std::__cxx11::string’ {aka ‘class std::__cxx11::basic_string<char>’} has no member named ‘ends_with’
   if (mnemonic.ends_with("l")) {
                ^~~~~~~~~
/home/pi/programs/resource_dasm/src/Emulators/PPC32Emulator.cc:1359:17: error: ‘std::__cxx11::string’ {aka ‘class std::__cxx11::basic_string<char>’} has no member named ‘ends_with’
   if (!mnemonic.ends_with("lr")) {
                 ^~~~~~~~~
/home/pi/programs/resource_dasm/src/Emulators/PPC32Emulator.cc: In member function ‘uint32_t PPC32Emulator::Assembler::asm_bcctr_mnemonic(const PPC32Emulator::Assembler::StreamItem&)’:
/home/pi/programs/resource_dasm/src/Emulators/PPC32Emulator.cc:1624:16: error: ‘std::__cxx11::string’ {aka ‘class std::__cxx11::basic_string<char>’} has no member named ‘ends_with’
   if (mnemonic.ends_with("l")) {
                ^~~~~~~~~
/home/pi/programs/resource_dasm/src/Emulators/PPC32Emulator.cc:1628:17: error: ‘std::__cxx11::string’ {aka ‘class std::__cxx11::basic_string<char>’} has no member named ‘ends_with’
   if (!mnemonic.ends_with("ctr")) {
                 ^~~~~~~~~
/home/pi/programs/resource_dasm/src/Emulators/PPC32Emulator.cc: In member function ‘uint32_t PPC32Emulator::Assembler::asm_mfspr_mnemonic(const PPC32Emulator::Assembler::StreamItem&)’:
/home/pi/programs/resource_dasm/src/Emulators/PPC32Emulator.cc:3546:21: error: ‘const string’ {aka ‘const class std::__cxx11::basic_string<char>’} has no member named ‘starts_with’
     if (!si.op_name.starts_with("mf")) {
                     ^~~~~~~~~~~
/home/pi/programs/resource_dasm/src/Emulators/PPC32Emulator.cc: In member function ‘uint32_t PPC32Emulator::Assembler::asm_mtspr_mnemonic(const PPC32Emulator::Assembler::StreamItem&)’:
/home/pi/programs/resource_dasm/src/Emulators/PPC32Emulator.cc:3784:21: error: ‘const string’ {aka ‘const class std::__cxx11::basic_string<char>’} has no member named ‘starts_with’
     if (!si.op_name.starts_with("mt")) {
                     ^~~~~~~~~~~
/home/pi/programs/resource_dasm/src/Emulators/PPC32Emulator.cc: In member function ‘uint32_t PPC32Emulator::Assembler::asm_fdivs(const PPC32Emulator::Assembler::StreamItem&)’:
/home/pi/programs/resource_dasm/src/Emulators/PPC32Emulator.cc:4926:18: error: ‘const string’ {aka ‘const class std::__cxx11::basic_string<char>’} has no member named ‘ends_with’
       si.op_name.ends_with("."));
                  ^~~~~~~~~
/home/pi/programs/resource_dasm/src/Emulators/PPC32Emulator.cc: In member function ‘uint32_t PPC32Emulator::Assembler::asm_fsubs(const PPC32Emulator::Assembler::StreamItem&)’:
/home/pi/programs/resource_dasm/src/Emulators/PPC32Emulator.cc:4943:18: error: ‘const string’ {aka ‘const class std::__cxx11::basic_string<char>’} has no member named ‘ends_with’
       si.op_name.ends_with("."));
                  ^~~~~~~~~
/home/pi/programs/resource_dasm/src/Emulators/PPC32Emulator.cc: In member function ‘uint32_t PPC32Emulator::Assembler::asm_fadds(const PPC32Emulator::Assembler::StreamItem&)’:
/home/pi/programs/resource_dasm/src/Emulators/PPC32Emulator.cc:4960:18: error: ‘const string’ {aka ‘const class std::__cxx11::basic_string<char>’} has no member named ‘ends_with’
       si.op_name.ends_with("."));
                  ^~~~~~~~~
/home/pi/programs/resource_dasm/src/Emulators/PPC32Emulator.cc: In member function ‘uint32_t PPC32Emulator::Assembler::asm_fsqrts(const PPC32Emulator::Assembler::StreamItem&)’:
/home/pi/programs/resource_dasm/src/Emulators/PPC32Emulator.cc:4977:18: error: ‘const string’ {aka ‘const class std::__cxx11::basic_string<char>’} has no member named ‘ends_with’
       si.op_name.ends_with("."));
                  ^~~~~~~~~
/home/pi/programs/resource_dasm/src/Emulators/PPC32Emulator.cc: In member function ‘uint32_t PPC32Emulator::Assembler::asm_fres(const PPC32Emulator::Assembler::StreamItem&)’:
/home/pi/programs/resource_dasm/src/Emulators/PPC32Emulator.cc:4994:18: error: ‘const string’ {aka ‘const class std::__cxx11::basic_string<char>’} has no member named ‘ends_with’
       si.op_name.ends_with("."));
                  ^~~~~~~~~
/home/pi/programs/resource_dasm/src/Emulators/PPC32Emulator.cc: In member function ‘uint32_t PPC32Emulator::Assembler::asm_fmuls(const PPC32Emulator::Assembler::StreamItem&)’:
/home/pi/programs/resource_dasm/src/Emulators/PPC32Emulator.cc:5011:18: error: ‘const string’ {aka ‘const class std::__cxx11::basic_string<char>’} has no member named ‘ends_with’
       si.op_name.ends_with("."));
                  ^~~~~~~~~
/home/pi/programs/resource_dasm/src/Emulators/PPC32Emulator.cc: In member function ‘uint32_t PPC32Emulator::Assembler::asm_fmsubs(const PPC32Emulator::Assembler::StreamItem&)’:
/home/pi/programs/resource_dasm/src/Emulators/PPC32Emulator.cc:5028:18: error: ‘const string’ {aka ‘const class std::__cxx11::basic_string<char>’} has no member named ‘ends_with’
       si.op_name.ends_with("."));
                  ^~~~~~~~~
/home/pi/programs/resource_dasm/src/Emulators/PPC32Emulator.cc: In member function ‘uint32_t PPC32Emulator::Assembler::asm_fmadds(const PPC32Emulator::Assembler::StreamItem&)’:
/home/pi/programs/resource_dasm/src/Emulators/PPC32Emulator.cc:5045:18: error: ‘const string’ {aka ‘const class std::__cxx11::basic_string<char>’} has no member named ‘ends_with’
       si.op_name.ends_with("."));
                  ^~~~~~~~~
/home/pi/programs/resource_dasm/src/Emulators/PPC32Emulator.cc: In member function ‘uint32_t PPC32Emulator::Assembler::asm_fnmsubs(const PPC32Emulator::Assembler::StreamItem&)’:
/home/pi/programs/resource_dasm/src/Emulators/PPC32Emulator.cc:5062:18: error: ‘const string’ {aka ‘const class std::__cxx11::basic_string<char>’} has no member named ‘ends_with’
       si.op_name.ends_with("."));
                  ^~~~~~~~~
/home/pi/programs/resource_dasm/src/Emulators/PPC32Emulator.cc: In member function ‘uint32_t PPC32Emulator::Assembler::asm_fnmadds(const PPC32Emulator::Assembler::StreamItem&)’:
/home/pi/programs/resource_dasm/src/Emulators/PPC32Emulator.cc:5079:18: error: ‘const string’ {aka ‘const class std::__cxx11::basic_string<char>’} has no member named ‘ends_with’
       si.op_name.ends_with("."));
                  ^~~~~~~~~
/home/pi/programs/resource_dasm/src/Emulators/PPC32Emulator.cc: In member function ‘uint32_t PPC32Emulator::Assembler::asm_fdiv(const PPC32Emulator::Assembler::StreamItem&)’:
/home/pi/programs/resource_dasm/src/Emulators/PPC32Emulator.cc:5258:18: error: ‘const string’ {aka ‘const class std::__cxx11::basic_string<char>’} has no member named ‘ends_with’
       si.op_name.ends_with("."));
                  ^~~~~~~~~
/home/pi/programs/resource_dasm/src/Emulators/PPC32Emulator.cc: In member function ‘uint32_t PPC32Emulator::Assembler::asm_fsub(const PPC32Emulator::Assembler::StreamItem&)’:
/home/pi/programs/resource_dasm/src/Emulators/PPC32Emulator.cc:5275:18: error: ‘const string’ {aka ‘const class std::__cxx11::basic_string<char>’} has no member named ‘ends_with’
       si.op_name.ends_with("."));
                  ^~~~~~~~~
/home/pi/programs/resource_dasm/src/Emulators/PPC32Emulator.cc: In member function ‘uint32_t PPC32Emulator::Assembler::asm_fadd(const PPC32Emulator::Assembler::StreamItem&)’:
/home/pi/programs/resource_dasm/src/Emulators/PPC32Emulator.cc:5292:18: error: ‘const string’ {aka ‘const class std::__cxx11::basic_string<char>’} has no member named ‘ends_with’
       si.op_name.ends_with("."));
                  ^~~~~~~~~
/home/pi/programs/resource_dasm/src/Emulators/PPC32Emulator.cc: In member function ‘uint32_t PPC32Emulator::Assembler::asm_fsqrt(const PPC32Emulator::Assembler::StreamItem&)’:
/home/pi/programs/resource_dasm/src/Emulators/PPC32Emulator.cc:5309:18: error: ‘const string’ {aka ‘const class std::__cxx11::basic_string<char>’} has no member named ‘ends_with’
       si.op_name.ends_with("."));
                  ^~~~~~~~~
/home/pi/programs/resource_dasm/src/Emulators/PPC32Emulator.cc: In member function ‘uint32_t PPC32Emulator::Assembler::asm_fsel(const PPC32Emulator::Assembler::StreamItem&)’:
/home/pi/programs/resource_dasm/src/Emulators/PPC32Emulator.cc:5326:18: error: ‘const string’ {aka ‘const class std::__cxx11::basic_string<char>’} has no member named ‘ends_with’
       si.op_name.ends_with("."));
                  ^~~~~~~~~
/home/pi/programs/resource_dasm/src/Emulators/PPC32Emulator.cc: In member function ‘uint32_t PPC32Emulator::Assembler::asm_fmul(const PPC32Emulator::Assembler::StreamItem&)’:
/home/pi/programs/resource_dasm/src/Emulators/PPC32Emulator.cc:5343:18: error: ‘const string’ {aka ‘const class std::__cxx11::basic_string<char>’} has no member named ‘ends_with’
       si.op_name.ends_with("."));
                  ^~~~~~~~~
/home/pi/programs/resource_dasm/src/Emulators/PPC32Emulator.cc: In member function ‘uint32_t PPC32Emulator::Assembler::asm_frsqrte(const PPC32Emulator::Assembler::StreamItem&)’:
/home/pi/programs/resource_dasm/src/Emulators/PPC32Emulator.cc:5359:18: error: ‘const string’ {aka ‘const class std::__cxx11::basic_string<char>’} has no member named ‘ends_with’
       si.op_name.ends_with("."));
                  ^~~~~~~~~
/home/pi/programs/resource_dasm/src/Emulators/PPC32Emulator.cc: In member function ‘uint32_t PPC32Emulator::Assembler::asm_fmsub(const PPC32Emulator::Assembler::StreamItem&)’:
/home/pi/programs/resource_dasm/src/Emulators/PPC32Emulator.cc:5376:18: error: ‘const string’ {aka ‘const class std::__cxx11::basic_string<char>’} has no member named ‘ends_with’
       si.op_name.ends_with("."));
                  ^~~~~~~~~
/home/pi/programs/resource_dasm/src/Emulators/PPC32Emulator.cc: In member function ‘uint32_t PPC32Emulator::Assembler::asm_fmadd(const PPC32Emulator::Assembler::StreamItem&)’:
/home/pi/programs/resource_dasm/src/Emulators/PPC32Emulator.cc:5393:18: error: ‘const string’ {aka ‘const class std::__cxx11::basic_string<char>’} has no member named ‘ends_with’
       si.op_name.ends_with("."));
                  ^~~~~~~~~
/home/pi/programs/resource_dasm/src/Emulators/PPC32Emulator.cc: In member function ‘uint32_t PPC32Emulator::Assembler::asm_fnmsub(const PPC32Emulator::Assembler::StreamItem&)’:
/home/pi/programs/resource_dasm/src/Emulators/PPC32Emulator.cc:5410:18: error: ‘const string’ {aka ‘const class std::__cxx11::basic_string<char>’} has no member named ‘ends_with’
       si.op_name.ends_with("."));
                  ^~~~~~~~~
/home/pi/programs/resource_dasm/src/Emulators/PPC32Emulator.cc: In member function ‘uint32_t PPC32Emulator::Assembler::asm_fnmadd(const PPC32Emulator::Assembler::StreamItem&)’:
/home/pi/programs/resource_dasm/src/Emulators/PPC32Emulator.cc:5427:18: error: ‘const string’ {aka ‘const class std::__cxx11::basic_string<char>’} has no member named ‘ends_with’
       si.op_name.ends_with("."));
                  ^~~~~~~~~
/home/pi/programs/resource_dasm/src/Emulators/PPC32Emulator.cc: In member function ‘uint32_t PPC32Emulator::Assembler::asm_frsp(const PPC32Emulator::Assembler::StreamItem&)’:
/home/pi/programs/resource_dasm/src/Emulators/PPC32Emulator.cc:5477:18: error: ‘const string’ {aka ‘const class std::__cxx11::basic_string<char>’} has no member named ‘ends_with’
       si.op_name.ends_with("."));
                  ^~~~~~~~~
/home/pi/programs/resource_dasm/src/Emulators/PPC32Emulator.cc: In member function ‘uint32_t PPC32Emulator::Assembler::asm_fctiw(const PPC32Emulator::Assembler::StreamItem&)’:
/home/pi/programs/resource_dasm/src/Emulators/PPC32Emulator.cc:5494:18: error: ‘const string’ {aka ‘const class std::__cxx11::basic_string<char>’} has no member named ‘ends_with’
       si.op_name.ends_with("."));
                  ^~~~~~~~~
/home/pi/programs/resource_dasm/src/Emulators/PPC32Emulator.cc: In member function ‘uint32_t PPC32Emulator::Assembler::asm_fctiwz(const PPC32Emulator::Assembler::StreamItem&)’:
/home/pi/programs/resource_dasm/src/Emulators/PPC32Emulator.cc:5511:18: error: ‘const string’ {aka ‘const class std::__cxx11::basic_string<char>’} has no member named ‘ends_with’
       si.op_name.ends_with("."));
                  ^~~~~~~~~
/home/pi/programs/resource_dasm/src/Emulators/PPC32Emulator.cc: In member function ‘uint32_t PPC32Emulator::Assembler::asm_mtfsb1(const PPC32Emulator::Assembler::StreamItem&)’:
/home/pi/programs/resource_dasm/src/Emulators/PPC32Emulator.cc:5564:56: error: ‘const string’ {aka ‘const class std::__cxx11::basic_string<char>’} has no member named ‘ends_with’
       a[0].reg_num, 0x00, 0x00, 0x01, 0x06, si.op_name.ends_with("."));
                                                        ^~~~~~~~~
/home/pi/programs/resource_dasm/src/Emulators/PPC32Emulator.cc: In member function ‘uint32_t PPC32Emulator::Assembler::asm_fneg(const PPC32Emulator::Assembler::StreamItem&)’:
/home/pi/programs/resource_dasm/src/Emulators/PPC32Emulator.cc:5581:18: error: ‘const string’ {aka ‘const class std::__cxx11::basic_string<char>’} has no member named ‘ends_with’
       si.op_name.ends_with("."));
                  ^~~~~~~~~
/home/pi/programs/resource_dasm/src/Emulators/PPC32Emulator.cc: In member function ‘uint32_t PPC32Emulator::Assembler::asm_mtfsbb(const PPC32Emulator::Assembler::StreamItem&)’:
/home/pi/programs/resource_dasm/src/Emulators/PPC32Emulator.cc:5618:18: error: ‘const string’ {aka ‘const class std::__cxx11::basic_string<char>’} has no member named ‘ends_with’
       si.op_name.ends_with("."));
                  ^~~~~~~~~
/home/pi/programs/resource_dasm/src/Emulators/PPC32Emulator.cc: In member function ‘uint32_t PPC32Emulator::Assembler::asm_fmr(const PPC32Emulator::Assembler::StreamItem&)’:
/home/pi/programs/resource_dasm/src/Emulators/PPC32Emulator.cc:5635:18: error: ‘const string’ {aka ‘const class std::__cxx11::basic_string<char>’} has no member named ‘ends_with’
       si.op_name.ends_with("."));
                  ^~~~~~~~~
/home/pi/programs/resource_dasm/src/Emulators/PPC32Emulator.cc: In member function ‘uint32_t PPC32Emulator::Assembler::asm_mtfsfi(const PPC32Emulator::Assembler::StreamItem&)’:
/home/pi/programs/resource_dasm/src/Emulators/PPC32Emulator.cc:5655:18: error: ‘const string’ {aka ‘const class std::__cxx11::basic_string<char>’} has no member named ‘ends_with’
       si.op_name.ends_with("."));
                  ^~~~~~~~~
/home/pi/programs/resource_dasm/src/Emulators/PPC32Emulator.cc: In member function ‘uint32_t PPC32Emulator::Assembler::asm_fnabs(const PPC32Emulator::Assembler::StreamItem&)’:
/home/pi/programs/resource_dasm/src/Emulators/PPC32Emulator.cc:5672:18: error: ‘const string’ {aka ‘const class std::__cxx11::basic_string<char>’} has no member named ‘ends_with’
       si.op_name.ends_with("."));
                  ^~~~~~~~~
/home/pi/programs/resource_dasm/src/Emulators/PPC32Emulator.cc: In member function ‘uint32_t PPC32Emulator::Assembler::asm_fabs(const PPC32Emulator::Assembler::StreamItem&)’:
/home/pi/programs/resource_dasm/src/Emulators/PPC32Emulator.cc:5689:18: error: ‘const string’ {aka ‘const class std::__cxx11::basic_string<char>’} has no member named ‘ends_with’
       si.op_name.ends_with("."));
                  ^~~~~~~~~
/home/pi/programs/resource_dasm/src/Emulators/PPC32Emulator.cc: In member function ‘uint32_t PPC32Emulator::Assembler::asm_mffs(const PPC32Emulator::Assembler::StreamItem&)’:
/home/pi/programs/resource_dasm/src/Emulators/PPC32Emulator.cc:5707:56: error: ‘const string’ {aka ‘const class std::__cxx11::basic_string<char>’} has no member named ‘ends_with’
       a[0].reg_num, 0x00, 0x00, 0x12, 0x07, si.op_name.ends_with("."));
                                                        ^~~~~~~~~
make[2]: *** [CMakeFiles/resource_file.dir/build.make:219: CMakeFiles/resource_file.dir/src/Emulators/PPC32Emulator.cc.o] Error 1
make[1]: *** [CMakeFiles/Makefile2:224: CMakeFiles/resource_file.dir/all] Error 2
make: *** [Makefile:130: all] Error 2
Kristine1975 commented 2 years ago
/home/pi/programs/resource_dasm/src/Emulators/PPC32Emulator.cc:1065:16: error: ‘std::__cxx11::string’ {aka ‘class std::__cxx11::basic_string<char>’} has no member named ‘ends_with’
   if (mnemonic.ends_with("a")) {
                ^~~~~~~~~

ends_with has been added in C++20, so the C++ standard library you're using is too old. resource_dasm needs C++20, I'm afraid.

Kristine1975 commented 2 years ago

PR #54 should fix the first problem.

fuzziqersoftware commented 2 years ago

For the ends_with issue, I'm a bit surprised that this didn't fail earlier, since CMakeLists.txt has set(CMAKE_CXX_STANDARD 20) and set(CMAKE_CXX_STANDARD_REQUIRED True). Regardless, there's an ends_with function in phosg from before most of my projects used C++20, and I've just pushed a change that switches PPC32Emulator to use that instead.

PalasX commented 2 years ago

updated to gcc 10.2, and debian 11 (from gcc 8.3 and deb 10) and got MUCH further. sorry i didnt even THINK about my gcc version.

[ 26%] Building CXX object CMakeFiles/resource_file.dir/src/Lookups.cc.o
/home/pi/programs/resource_dasm/src/Lookups.cc: In function ‘const char* name_for_region_code(uint16_t)’:
/home/pi/programs/resource_dasm/src/Lookups.cc:177:18: error: ISO C++ forbids declaration of ‘out_of_range’ with no type [-fpermissive]
  177 |   } catch (const out_of_range&) {
      |                  ^~~~~~~~~~~~
/home/pi/programs/resource_dasm/src/Lookups.cc:177:30: error: expected ‘)’ before ‘&’ token
  177 |   } catch (const out_of_range&) {
      |           ~                  ^
      |                              )
/home/pi/programs/resource_dasm/src/Lookups.cc:177:30: error: expected ‘{’ before ‘&’ token
/home/pi/programs/resource_dasm/src/Lookups.cc:177:31: error: expected primary-expression before ‘)’ token
  177 |   } catch (const out_of_range&) {
      |                               ^
/home/pi/programs/resource_dasm/src/Lookups.cc: In function ‘const char* name_for_font_id(uint16_t)’:
/home/pi/programs/resource_dasm/src/Lookups.cc:185:18: error: ISO C++ forbids declaration of ‘out_of_range’ with no type [-fpermissive]
  185 |   } catch (const out_of_range&) {
      |                  ^~~~~~~~~~~~
/home/pi/programs/resource_dasm/src/Lookups.cc:185:30: error: expected ‘)’ before ‘&’ token
  185 |   } catch (const out_of_range&) {
      |           ~                  ^
      |                              )
/home/pi/programs/resource_dasm/src/Lookups.cc:185:30: error: expected ‘{’ before ‘&’ token
/home/pi/programs/resource_dasm/src/Lookups.cc:185:31: error: expected primary-expression before ‘)’ token
  185 |   } catch (const out_of_range&) {
      |                               ^
/home/pi/programs/resource_dasm/src/Lookups.cc: In function ‘const char* name_for_region_code(uint16_t)’:
/home/pi/programs/resource_dasm/src/Lookups.cc:180:1: error: control reaches end of non-void function [-Werror=return-type]
  180 | }
      | ^
/home/pi/programs/resource_dasm/src/Lookups.cc: In function ‘const char* name_for_font_id(uint16_t)’:
/home/pi/programs/resource_dasm/src/Lookups.cc:188:1: error: control reaches end of non-void function [-Werror=return-type]
  188 | }
      | ^
cc1plus: all warnings being treated as errors
make[2]: *** [CMakeFiles/resource_file.dir/build.make:407: CMakeFiles/resource_file.dir/src/Lookups.cc.o] Error 1
make[1]: *** [CMakeFiles/Makefile2:297: CMakeFiles/resource_file.dir/all] Error 2
make: *** [Makefile:149: all] Error 2

pi@RasPi4Osoyoo:~/programs/resource_dasm $ lsb_release -a
No LSB modules are available.
Distributor ID: Raspbian
Description:    Raspbian GNU/Linux 11 (bullseye)
Release:        11
Codename:       bullseye
pi@RasPi4Osoyoo:~/programs/resource_dasm $ gcc --version
gcc (Raspbian 10.2.1-6+rpi1) 10.2.1 20210110
Copyright (C) 2020 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
fuzziqersoftware commented 2 years ago

Looks like some includes were missing in that file - I added them just now. Thanks for your patience, and sorry this doesn't work out-of-the-box on some systems... it's essentially only been used on macOS and Ubuntu so far.

PalasX commented 2 years ago

No worries! Thank you for being so immediately responsive! Project clearly states that it was built on macOS, so it's to be expected.

Im honestly just surprised no one else has tried and run into these issues so far.

again, thank you so much and so sorry to bother you with what feels less like "bug report" and more like "help desk".

PalasX commented 2 years ago

got phosg compiled, by adding -latomic manually, but it looks like it installs debug, and not release when doing a: sudo make install

this seems to cause resource_dasm to fail to cmake:

pi@RasPi4Osoyoo:~/programs/resource_dasm $ cmake .
-- The C compiler identification is GNU 10.2.1
-- The CXX compiler identification is GNU 10.2.1
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: /usr/bin/cc - skipped
-- Detecting C compile features
-- Detecting C compile features - done
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: /usr/bin/c++ - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
CMake Error at CMakeLists.txt:24 (find_package):
  By not providing "Findphosg.cmake" in CMAKE_MODULE_PATH this project has
  asked CMake to find a package configuration file provided by "phosg", but
  CMake did not find one.

  Could not find a package configuration file provided by "phosg" with any of
  the following names:

    phosgConfig.cmake
    phosg-config.cmake

  Add the installation prefix of "phosg" to CMAKE_PREFIX_PATH or set
  "phosg_DIR" to a directory containing one of the above files.  If "phosg"
  provides a separate development package or SDK, be sure it has been
  installed.

-- Configuring incomplete, errors occurred!
See also "/home/pi/programs/resource_dasm/CMakeFiles/CMakeOutput.log".

snippit from CMakeOutput.log:

Configured with: ../src/configure -v --with-pkgversion='Raspbian 10.2.1-6+rpi1' --with-bugurl=file:///usr/share/doc/gcc-10/README.Bugs --enable-languages=c,ada,c++,go,d,fortran,objc,obj-c++,m2 --prefix=/usr --with-gcc-major-version-
only --program-suffix=-10 --program-prefix=arm-linux-gnueabihf- --enable-shared --enable-linker-build-id --libexecdir=/usr/lib --without-included-gettext --enable-threads=posix --libdir=/usr/lib --enable-nls --enable-bootstrap
 --enable-clocale=gnu --enable-libstdcxx-debug --enable-libstdcxx-time=yes --with-default-libstdcxx-abi=new --enable-gnu-unique-object --disable-libitm --disable-libquadmath --disable-libquadmath-support --enable-plugin
 --with-system-zlib --enable-libphobos-checking=release --with-target-system-zlib=auto --enable-objc-gc=auto --enable-multiarch --disable-sjlj-exceptions --with-arch=armv6 --with-fpu=vfp --with-float=hard --disable-werror --enable-check>

Looks like its only checking for phosg RELEASE? so i went back and forced phosg's make install to install release, but i still got the same error.

What DID work was updating the CMakeFiles.txt for resource_dasm to exclude your addition of find_library(phosg). just commented it out entirely.

And with GCC 10.2, on Debian 11 (raspian bullseye), i got SOOOO far, and then ran into this:

[ 58%] Building CXX object CMakeFiles/icon_dearchiver.dir/src/icon_dearchiver.cc.o
/home/pi/programs/resource_dasm/src/icon_dearchiver.cc:11:10: fatal error: zlib.h: No such file or directory
   11 | #include <zlib.h>
      |          ^~~~~~~~
compilation terminated.
make[2]: *** [CMakeFiles/icon_dearchiver.dir/build.make:82: CMakeFiles/icon_dearchiver.dir/src/icon_dearchiver.cc.o] Error 1
make[1]: *** [CMakeFiles/Makefile2:135: CMakeFiles/icon_dearchiver.dir/all] Error 2
make: *** [Makefile:149: all] Error 2

ZLIB? are you kidding me? :D ok, apt-get install zlibg1-dev, and try again:

[ 58%] Building CXX object CMakeFiles/icon_dearchiver.dir/src/icon_dearchiver.cc.o
/home/pi/programs/resource_dasm/src/icon_dearchiver.cc: In function ‘constexpr uint8_t icns_type_to_icns_idx(uint32_t)’:
/home/pi/programs/resource_dasm/src/icon_dearchiver.cc:66:3: error: expression ‘<throw-expression>’ is not a constant expression
   66 |   throw logic_error("Unsupported icns icon type");
      |   ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/home/pi/programs/resource_dasm/src/icon_dearchiver.cc: At global scope:
/home/pi/programs/resource_dasm/src/icon_dearchiver.cc:71:64: error: ‘constexpr uint8_t icns_type_to_icns_idx(uint32_t)’ called in a constant expression
   71 | static constexpr uint8_t ICON_TYPE_ICNN = icns_type_to_icns_idx(RESOURCE_TYPE_ICNN);
      |                                           ~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~
/home/pi/programs/resource_dasm/src/icon_dearchiver.cc:60:26: note: ‘constexpr uint8_t icns_type_to_icns_idx(uint32_t)’ declared here
   60 | static constexpr uint8_t icns_type_to_icns_idx(uint32_t icns_type) {
      |                          ^~~~~~~~~~~~~~~~~~~~~
/home/pi/programs/resource_dasm/src/icon_dearchiver.cc:72:64: error: ‘constexpr uint8_t icns_type_to_icns_idx(uint32_t)’ called in a constant expression
   72 | static constexpr uint8_t ICON_TYPE_icl4 = icns_type_to_icns_idx(RESOURCE_TYPE_icl4);
      |                                           ~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~
/home/pi/programs/resource_dasm/src/icon_dearchiver.cc:60:26: note: ‘constexpr uint8_t icns_type_to_icns_idx(uint32_t)’ declared here
   60 | static constexpr uint8_t icns_type_to_icns_idx(uint32_t icns_type) {
      |                          ^~~~~~~~~~~~~~~~~~~~~
/home/pi/programs/resource_dasm/src/icon_dearchiver.cc:73:64: error: ‘constexpr uint8_t icns_type_to_icns_idx(uint32_t)’ called in a constant expression
   73 | static constexpr uint8_t ICON_TYPE_icl8 = icns_type_to_icns_idx(RESOURCE_TYPE_icl8);
      |                                           ~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~
/home/pi/programs/resource_dasm/src/icon_dearchiver.cc:60:26: note: ‘constexpr uint8_t icns_type_to_icns_idx(uint32_t)’ declared here
   60 | static constexpr uint8_t icns_type_to_icns_idx(uint32_t icns_type) {
      |                          ^~~~~~~~~~~~~~~~~~~~~
/home/pi/programs/resource_dasm/src/icon_dearchiver.cc:74:64: error: ‘constexpr uint8_t icns_type_to_icns_idx(uint32_t)’ called in a constant expression
   74 | static constexpr uint8_t ICON_TYPE_il32 = icns_type_to_icns_idx(RESOURCE_TYPE_il32);
      |                                           ~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~
/home/pi/programs/resource_dasm/src/icon_dearchiver.cc:60:26: note: ‘constexpr uint8_t icns_type_to_icns_idx(uint32_t)’ declared here
   60 | static constexpr uint8_t icns_type_to_icns_idx(uint32_t icns_type) {
      |                          ^~~~~~~~~~~~~~~~~~~~~
/home/pi/programs/resource_dasm/src/icon_dearchiver.cc:75:64: error: ‘constexpr uint8_t icns_type_to_icns_idx(uint32_t)’ called in a constant expression
   75 | static constexpr uint8_t ICON_TYPE_l8mk = icns_type_to_icns_idx(RESOURCE_TYPE_l8mk);
      |                                           ~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~
/home/pi/programs/resource_dasm/src/icon_dearchiver.cc:60:26: note: ‘constexpr uint8_t icns_type_to_icns_idx(uint32_t)’ declared here
   60 | static constexpr uint8_t icns_type_to_icns_idx(uint32_t icns_type) {
      |                          ^~~~~~~~~~~~~~~~~~~~~
/home/pi/programs/resource_dasm/src/icon_dearchiver.cc:77:64: error: ‘constexpr uint8_t icns_type_to_icns_idx(uint32_t)’ called in a constant expression
   77 | static constexpr uint8_t ICON_TYPE_icsN = icns_type_to_icns_idx(RESOURCE_TYPE_icsN);
      |                                           ~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~
/home/pi/programs/resource_dasm/src/icon_dearchiver.cc:60:26: note: ‘constexpr uint8_t icns_type_to_icns_idx(uint32_t)’ declared here
   60 | static constexpr uint8_t icns_type_to_icns_idx(uint32_t icns_type) {
      |                          ^~~~~~~~~~~~~~~~~~~~~
/home/pi/programs/resource_dasm/src/icon_dearchiver.cc:78:64: error: ‘constexpr uint8_t icns_type_to_icns_idx(uint32_t)’ called in a constant expression
   78 | static constexpr uint8_t ICON_TYPE_ics4 = icns_type_to_icns_idx(RESOURCE_TYPE_ics4);
      |                                           ~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~
/home/pi/programs/resource_dasm/src/icon_dearchiver.cc:60:26: note: ‘constexpr uint8_t icns_type_to_icns_idx(uint32_t)’ declared here
   60 | static constexpr uint8_t icns_type_to_icns_idx(uint32_t icns_type) {
      |                          ^~~~~~~~~~~~~~~~~~~~~
/home/pi/programs/resource_dasm/src/icon_dearchiver.cc:79:64: error: ‘constexpr uint8_t icns_type_to_icns_idx(uint32_t)’ called in a constant expression
   79 | static constexpr uint8_t ICON_TYPE_ics8 = icns_type_to_icns_idx(RESOURCE_TYPE_ics8);
      |                                           ~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~
/home/pi/programs/resource_dasm/src/icon_dearchiver.cc:60:26: note: ‘constexpr uint8_t icns_type_to_icns_idx(uint32_t)’ declared here
   60 | static constexpr uint8_t icns_type_to_icns_idx(uint32_t icns_type) {
      |                          ^~~~~~~~~~~~~~~~~~~~~
/home/pi/programs/resource_dasm/src/icon_dearchiver.cc:80:64: error: ‘constexpr uint8_t icns_type_to_icns_idx(uint32_t)’ called in a constant expression
   80 | static constexpr uint8_t ICON_TYPE_is32 = icns_type_to_icns_idx(RESOURCE_TYPE_is32);
      |                                           ~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~
/home/pi/programs/resource_dasm/src/icon_dearchiver.cc:60:26: note: ‘constexpr uint8_t icns_type_to_icns_idx(uint32_t)’ declared here
   60 | static constexpr uint8_t icns_type_to_icns_idx(uint32_t icns_type) {
      |                          ^~~~~~~~~~~~~~~~~~~~~
/home/pi/programs/resource_dasm/src/icon_dearchiver.cc:81:64: error: ‘constexpr uint8_t icns_type_to_icns_idx(uint32_t)’ called in a constant expression
   81 | static constexpr uint8_t ICON_TYPE_s8mk = icns_type_to_icns_idx(RESOURCE_TYPE_s8mk);
      |                                           ~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~
/home/pi/programs/resource_dasm/src/icon_dearchiver.cc:60:26: note: ‘constexpr uint8_t icns_type_to_icns_idx(uint32_t)’ declared here
   60 | static constexpr uint8_t icns_type_to_icns_idx(uint32_t icns_type) {
      |                          ^~~~~~~~~~~~~~~~~~~~~
/home/pi/programs/resource_dasm/src/icon_dearchiver.cc:83:64: error: ‘constexpr uint8_t icns_type_to_icns_idx(uint32_t)’ called in a constant expression
   83 | static constexpr uint8_t ICON_TYPE_ichN = icns_type_to_icns_idx(RESOURCE_TYPE_ichN);
      |                                           ~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~
/home/pi/programs/resource_dasm/src/icon_dearchiver.cc:60:26: note: ‘constexpr uint8_t icns_type_to_icns_idx(uint32_t)’ declared here
   60 | static constexpr uint8_t icns_type_to_icns_idx(uint32_t icns_type) {
      |                          ^~~~~~~~~~~~~~~~~~~~~
/home/pi/programs/resource_dasm/src/icon_dearchiver.cc:84:64: error: ‘constexpr uint8_t icns_type_to_icns_idx(uint32_t)’ called in a constant expression
   84 | static constexpr uint8_t ICON_TYPE_ich4 = icns_type_to_icns_idx(RESOURCE_TYPE_ich4);
      |                                           ~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~
/home/pi/programs/resource_dasm/src/icon_dearchiver.cc:60:26: note: ‘constexpr uint8_t icns_type_to_icns_idx(uint32_t)’ declared here
   60 | static constexpr uint8_t icns_type_to_icns_idx(uint32_t icns_type) {
      |                          ^~~~~~~~~~~~~~~~~~~~~
/home/pi/programs/resource_dasm/src/icon_dearchiver.cc:85:64: error: ‘constexpr uint8_t icns_type_to_icns_idx(uint32_t)’ called in a constant expression
   85 | static constexpr uint8_t ICON_TYPE_ich8 = icns_type_to_icns_idx(RESOURCE_TYPE_ich8);
      |                                           ~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~
/home/pi/programs/resource_dasm/src/icon_dearchiver.cc:60:26: note: ‘constexpr uint8_t icns_type_to_icns_idx(uint32_t)’ declared here
   60 | static constexpr uint8_t icns_type_to_icns_idx(uint32_t icns_type) {
      |                          ^~~~~~~~~~~~~~~~~~~~~
/home/pi/programs/resource_dasm/src/icon_dearchiver.cc:86:64: error: ‘constexpr uint8_t icns_type_to_icns_idx(uint32_t)’ called in a constant expression
   86 | static constexpr uint8_t ICON_TYPE_ih32 = icns_type_to_icns_idx(RESOURCE_TYPE_ih32);
      |                                           ~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~
/home/pi/programs/resource_dasm/src/icon_dearchiver.cc:60:26: note: ‘constexpr uint8_t icns_type_to_icns_idx(uint32_t)’ declared here
   60 | static constexpr uint8_t icns_type_to_icns_idx(uint32_t icns_type) {
      |                          ^~~~~~~~~~~~~~~~~~~~~
/home/pi/programs/resource_dasm/src/icon_dearchiver.cc:87:64: error: ‘constexpr uint8_t icns_type_to_icns_idx(uint32_t)’ called in a constant expression
   87 | static constexpr uint8_t ICON_TYPE_h8mk = icns_type_to_icns_idx(RESOURCE_TYPE_h8mk);
      |                                           ~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~
/home/pi/programs/resource_dasm/src/icon_dearchiver.cc:60:26: note: ‘constexpr uint8_t icns_type_to_icns_idx(uint32_t)’ declared here
   60 | static constexpr uint8_t icns_type_to_icns_idx(uint32_t icns_type) {
      |                          ^~~~~~~~~~~~~~~~~~~~~
make[2]: *** [CMakeFiles/icon_dearchiver.dir/build.make:82: CMakeFiles/icon_dearchiver.dir/src/icon_dearchiver.cc.o] Error 1
make[1]: *** [CMakeFiles/Makefile2:135: CMakeFiles/icon_dearchiver.dir/all] Error 2
make: *** [Makefile:149: all] Error 2
Kristine1975 commented 2 years ago

ZLIB? are you kidding me? :D ok, apt-get install zlibg1-dev, and try again:

There are really systems without preinstalled zlib? I thought it was literally everywhere, that's why I had no qualms about the additional dependency when writing icon_dearchiver.

error: expression ‘<throw-expression>’ is not a constant expression

That's a bug in gcc 10.2. The code compiles in gcc 10.3: https://godbolt.org/z/9xdoc5hhW

As a workaround, delete the throw statement. It should never be reached.

PalasX commented 2 years ago

Get;s a little further after commenting out that THROW, but hits another size_t/long issue. I'm going to budget out some time this afternoon for this, and i'll get my GCC version as up to date as the system will "allow" me.

[ 62%] Building CXX object CMakeFiles/realmz_dasm.dir/src/RealmzScenarioData.cc.o
/home/pi/programs/resource_dasm/src/RealmzScenarioData.cc: In member function ‘std::string RealmzScenarioData::disassemble_xap(int16_t)’:
/home/pi/programs/resource_dasm/src/RealmzScenarioData.cc:1859:72: error: format ‘%lu’ expects argument of type ‘long unsigned int’, but argument 2 has type ‘size_t’ {aka ‘unsigned int’} [-Werror=format=]
 1859 |         data += string_printf("RANDOM RECTANGLE REFERENCE land_level=%lu rect_num=%lu start_coord=%d,%d end_coord=%d,%d [LRR%lu/%lu]\n",
      |                                                                      ~~^
      |                                                                        |
      |                                                                        long unsigned int
      |                                                                      %u
 1860 |             x, y, r.left, r.top, r.right, r.bottom, x, y);
      |             ~
      |             |
      |             size_t {aka unsigned int}
/home/pi/programs/resource_dasm/src/RealmzScenarioData.cc:1859:85: error: format ‘%lu’ expects argument of type ‘long unsigned int’, but argument 3 has type ‘size_t’ {aka ‘unsigned int’} [-Werror=format=]
 1859 |         data += string_printf("RANDOM RECTANGLE REFERENCE land_level=%lu rect_num=%lu start_coord=%d,%d end_coord=%d,%d [LRR%lu/%lu]\n",
      |                                                                                   ~~^
      |                                                                                     |
      |                                                                                     long unsigned int
      |                                                                                   %u
 1860 |             x, y, r.left, r.top, r.right, r.bottom, x, y);
      |                ~
      |                |
      |                size_t {aka unsigned int}
/home/pi/programs/resource_dasm/src/RealmzScenarioData.cc:1859:127: error: format ‘%lu’ expects argument of type ‘long unsigned int’, but argument 8 has type ‘size_t’ {aka ‘unsigned int’} [-Werror=format=]
 1859 | ng_printf("RANDOM RECTANGLE REFERENCE land_level=%lu rect_num=%lu start_coord=%d,%d end_coord=%d,%d [LRR%lu/%lu]\n",
      |                                                                                                         ~~^
      |                                                                                                           |
      |                                                                                                           long unsigned int
      |                                                                                                         %u
 1860 | left, r.top, r.right, r.bottom, x, y);
      |                                 ~
      |                                 |
      |                                 size_t {aka unsigned int}

/home/pi/programs/resource_dasm/src/RealmzScenarioData.cc:1859:131: error: format ‘%lu’ expects argument of type ‘long unsigned int’, but argument 9 has type ‘size_t’ {aka ‘unsigned int’} [-Werror=format=]
 1859 | ng_printf("RANDOM RECTANGLE REFERENCE land_level=%lu rect_num=%lu start_coord=%d,%d end_coord=%d,%d [LRR%lu/%lu]\n",
      |                                                                                                             ~~^
      |                                                                                                               |
      |                                                                                                               long unsigned int
      |                                                                                                             %u
 1860 | left, r.top, r.right, r.bottom, x, y);
      |                                    ~
      |                                    |
      |                                    size_t {aka unsigned int}

/home/pi/programs/resource_dasm/src/RealmzScenarioData.cc:1870:75: error: format ‘%lu’ expects argument of type ‘long unsigned int’, but argument 2 has type ‘size_t’ {aka ‘unsigned int’} [-Werror=format=]
 1870 |         data += string_printf("RANDOM RECTANGLE REFERENCE dungeon_level=%lu rect_num=%lu start_coord=%d,%d end_coord=%d,%d [DRR%lu/%lu]\n",
      |                                                                         ~~^
      |                                                                           |
      |                                                                           long unsigned int
      |                                                                         %u
 1871 |             x, y, r.left, r.top, r.right, r.bottom, x, y);
      |             ~
      |             |
      |             size_t {aka unsigned int}
/home/pi/programs/resource_dasm/src/RealmzScenarioData.cc:1870:88: error: format ‘%lu’ expects argument of type ‘long unsigned int’, but argument 3 has type ‘size_t’ {aka ‘unsigned int’} [-Werror=format=]
 1870 |         data += string_printf("RANDOM RECTANGLE REFERENCE dungeon_level=%lu rect_num=%lu start_coord=%d,%d end_coord=%d,%d [DRR%lu/%lu]\n",
      |                                                                                      ~~^
      |                                                                                        |
      |                                                                                        long unsigned int
      |                                                                                      %u
 1871 |             x, y, r.left, r.top, r.right, r.bottom, x, y);
      |                ~
      |                |
      |                size_t {aka unsigned int}
/home/pi/programs/resource_dasm/src/RealmzScenarioData.cc:1870:130: error: format ‘%lu’ expects argument of type ‘long unsigned int’, but argument 8 has type ‘size_t’ {aka ‘unsigned int’} [-Werror=format=]
 1870 | printf("RANDOM RECTANGLE REFERENCE dungeon_level=%lu rect_num=%lu start_coord=%d,%d end_coord=%d,%d [DRR%lu/%lu]\n",
      |                                                                                                         ~~^
      |                                                                                                           |
      |                                                                                                           long unsigned int
      |                                                                                                         %u
 1871 | t, r.top, r.right, r.bottom, x, y);
      |                              ~
      |                              |
      |                              size_t {aka unsigned int}

/home/pi/programs/resource_dasm/src/RealmzScenarioData.cc:1870:134: error: format ‘%lu’ expects argument of type ‘long unsigned int’, but argument 9 has type ‘size_t’ {aka ‘unsigned int’} [-Werror=format=]
 1870 | printf("RANDOM RECTANGLE REFERENCE dungeon_level=%lu rect_num=%lu start_coord=%d,%d end_coord=%d,%d [DRR%lu/%lu]\n",
      |                                                                                                             ~~^
      |                                                                                                               |
      |                                                                                                               long unsigned int
      |                                                                                                             %u
 1871 | t, r.top, r.right, r.bottom, x, y);
      |                                 ~
      |                                 |
      |                                 size_t {aka unsigned int}

cc1plus: all warnings being treated as errors
make[2]: *** [CMakeFiles/realmz_dasm.dir/build.make:108: CMakeFiles/realmz_dasm.dir/src/RealmzScenarioData.cc.o] Error 1
make[1]: *** [CMakeFiles/Makefile2:162: CMakeFiles/realmz_dasm.dir/all] Error 2
make: *** [Makefile:149: all] Error 2
PalasX commented 2 years ago

Fresh install of OS for raspi4, updated to latest available debian package for it, which was 10.2.1, compiled and isntalled gcc/g++ 11.1 for raspi4, which took like 4-5 hours :)

got MUCH further!

ran this:

pi@RasPi4Osoyoo:~/programs/resource_dasm $ cmake -DCMAKE_C_COMPILER=/usr/local/bin/gcc -DCMAKE_CXX_COMPILER=/usr/local/bin/g++ .
-- Configuring done
You have changed variables that require your cache to be deleted.
Configure will be re-run and you may have to reset some variables.
The following variables have changed:
CMAKE_C_COMPILER= /usr/local/bin/gcc
CMAKE_CXX_COMPILER= /usr/local/bin/g++

-- The C compiler identification is GNU 11.1.0
-- The CXX compiler identification is GNU 11.1.0
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: /usr/local/bin/gcc - skipped
-- Detecting C compile features
-- Detecting C compile features - done
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: /usr/local/bin/g++ - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Configuring done
-- Generating done
-- Build files have been written to: /home/pi/programs/resource_dasm

Got this:

[ 74%] Building CXX object CMakeFiles/resource_dasm.dir/src/resource_dasm.cc.o
/home/pi/programs/resource_dasm/src/resource_dasm.cc:1968:3: error: ‘optional’ does not name a type
 1968 |   optional<ResourceIDs> target_ids;
      |   ^~~~~~~~
/home/pi/programs/resource_dasm/src/resource_dasm.cc:1970:3: error: ‘optional’ does not name a type
 1970 |   optional<ResourceIDs> skip_ids;
      |   ^~~~~~~~
/home/pi/programs/resource_dasm/src/resource_dasm.cc: In member function ‘bool ResourceExporter::is_included(uint32_t, int16_                                                                                                                t) const’:
/home/pi/programs/resource_dasm/src/resource_dasm.cc:1768:50: error: ‘const class ResourceExporter’ has no member named ‘targ                                                                                                                et_ids’; did you mean ‘target_names’?
 1768 |     if (this->target_types_ids.empty() && !this->target_ids && this->target_names.empty()) {
      |                                                  ^~~~~~~~~~
      |                                                  target_names
/home/pi/programs/resource_dasm/src/resource_dasm.cc:1773:15: error: ‘const class ResourceExporter’ has no member named ‘targ                                                                                                                et_ids’; did you mean ‘target_names’?
 1773 |     if (this->target_ids && (*this->target_ids)[id]) {
      |               ^~~~~~~~~~
      |               target_names
/home/pi/programs/resource_dasm/src/resource_dasm.cc:1773:37: error: ‘const class ResourceExporter’ has no member named ‘targ                                                                                                                et_ids’; did you mean ‘target_names’?
 1773 |     if (this->target_ids && (*this->target_ids)[id]) {
      |                                     ^~~~~~~~~~
      |                                     target_names
/home/pi/programs/resource_dasm/src/resource_dasm.cc: In member function ‘bool ResourceExporter::is_excluded(uint32_t, int16_                                                                                                                t) const’:
/home/pi/programs/resource_dasm/src/resource_dasm.cc:1797:15: error: ‘const class ResourceExporter’ has no member named ‘skip                                                                                                                _ids’; did you mean ‘skip_names’?
 1797 |     if (this->skip_ids && (*this->skip_ids)[id]) {
      |               ^~~~~~~~
      |               skip_names
/home/pi/programs/resource_dasm/src/resource_dasm.cc:1797:35: error: ‘const class ResourceExporter’ has no member named ‘skip                                                                                                                _ids’; did you mean ‘skip_names’?
 1797 |     if (this->skip_ids && (*this->skip_ids)[id]) {
      |                                   ^~~~~~~~
      |                                   skip_names
/home/pi/programs/resource_dasm/src/resource_dasm.cc: In function ‘int main(int, char**)’:
/home/pi/programs/resource_dasm/src/resource_dasm.cc:2757:25: error: ‘class ResourceExporter’ has no member named ‘target_ids                                                                                                                ’; did you mean ‘target_names’?
 2757 |           if (!exporter.target_ids) {
      |                         ^~~~~~~~~~
      |                         target_names
/home/pi/programs/resource_dasm/src/resource_dasm.cc:2758:22: error: ‘class ResourceExporter’ has no member named ‘target_ids                                                                                                                ’; did you mean ‘target_names’?
 2758 |             exporter.target_ids = ResourceIDs(ResourceIDs::Init::NONE);
      |                      ^~~~~~~~~~
      |                      target_names
/home/pi/programs/resource_dasm/src/resource_dasm.cc:2760:49: error: ‘class ResourceExporter’ has no member named ‘target_ids                                                                                                                ’; did you mean ‘target_names’?
 2760 |           parse_cli_ids(&argv[x][12], *exporter.target_ids);
      |                                                 ^~~~~~~~~~
      |                                                 target_names
/home/pi/programs/resource_dasm/src/resource_dasm.cc:2762:25: error: ‘class ResourceExporter’ has no member named ‘skip_ids’;                                                                                                                 did you mean ‘skip_names’?
 2762 |           if (!exporter.skip_ids) {
      |                         ^~~~~~~~
      |                         skip_names
/home/pi/programs/resource_dasm/src/resource_dasm.cc:2763:22: error: ‘class ResourceExporter’ has no member named ‘skip_ids’;                                                                                                                 did you mean ‘skip_names’?
 2763 |             exporter.skip_ids = ResourceIDs(ResourceIDs::Init::NONE);
      |                      ^~~~~~~~
      |                      skip_names
/home/pi/programs/resource_dasm/src/resource_dasm.cc:2765:49: error: ‘class ResourceExporter’ has no member named ‘skip_ids’;                                                                                                                 did you mean ‘skip_names’?
 2765 |           parse_cli_ids(&argv[x][10], *exporter.skip_ids);
      |                                                 ^~~~~~~~
      |                                                 skip_names
/home/pi/programs/resource_dasm/src/resource_dasm.cc:2906:18: error: ‘class ResourceExporter’ has no member named ‘target_ids                                                                                                                ’; did you mean ‘target_names’?
 2906 |         exporter.target_ids.reset();
      |                  ^~~~~~~~~~
      |                  target_names
/home/pi/programs/resource_dasm/src/resource_dasm.cc:2909:18: error: ‘class ResourceExporter’ has no member named ‘skip_ids’;                                                                                                                 did you mean ‘skip_names’?
 2909 |         exporter.skip_ids.reset();
      |                  ^~~~~~~~
      |                  skip_names
make[2]: *** [CMakeFiles/resource_dasm.dir/build.make:82: CMakeFiles/resource_dasm.dir/src/resource_dasm.cc.o] Error 1
make[1]: *** [CMakeFiles/Makefile2:351: CMakeFiles/resource_dasm.dir/all] Error 2
make: *** [Makefile:149: all] Error 2
PalasX commented 2 years ago

fresh install/update/upgrade of ubuntu 22.04 lts, which comes with gcc/g++ 11.3, and a fresh git clone. still getting these:

[ 60%] Building CXX object CMakeFiles/resource_dasm.dir/src/resource_dasm.cc.o
/home/owner/programs/resource_dasm/src/resource_dasm.cc:1968:3: error: ‘optional’ does not name a type
 1968 |   optional<ResourceIDs> target_ids;
      |   ^~~~~~~~
/home/owner/programs/resource_dasm/src/resource_dasm.cc:1970:3: error: ‘optional’ does not name a type
 1970 |   optional<ResourceIDs> skip_ids;
      |   ^~~~~~~~
/home/owner/programs/resource_dasm/src/resource_dasm.cc: In member function ‘bool ResourceExporter::is_included(uint32_t, int16_t) const’:
/home/owner/programs/resource_dasm/src/resource_dasm.cc:1768:50: error: ‘const class ResourceExporter’ has no member named ‘target_ids’; did you mean ‘target_names’?
 1768 |     if (this->target_types_ids.empty() && !this->target_ids && this->target_names.empty()) {
      |                                                  ^~~~~~~~~~
      |                                                  target_names
/home/owner/programs/resource_dasm/src/resource_dasm.cc:1773:15: error: ‘const class ResourceExporter’ has no member named ‘target_ids’; did you mean ‘target_names’?
 1773 |     if (this->target_ids && (*this->target_ids)[id]) {
      |               ^~~~~~~~~~
      |               target_names
/home/owner/programs/resource_dasm/src/resource_dasm.cc:1773:37: error: ‘const class ResourceExporter’ has no member named ‘target_ids’; did you mean ‘target_names’?
 1773 |     if (this->target_ids && (*this->target_ids)[id]) {
      |                                     ^~~~~~~~~~
      |                                     target_names
/home/owner/programs/resource_dasm/src/resource_dasm.cc: In member function ‘bool ResourceExporter::is_excluded(uint32_t, int16_t) const’:
/home/owner/programs/resource_dasm/src/resource_dasm.cc:1797:15: error: ‘const class ResourceExporter’ has no member named ‘skip_ids’; did you mean ‘skip_names’?
 1797 |     if (this->skip_ids && (*this->skip_ids)[id]) {
      |               ^~~~~~~~
      |               skip_names
/home/owner/programs/resource_dasm/src/resource_dasm.cc:1797:35: error: ‘const class ResourceExporter’ has no member named ‘skip_ids’; did you mean ‘skip_names’?
 1797 |     if (this->skip_ids && (*this->skip_ids)[id]) {
      |                                   ^~~~~~~~
      |                                   skip_names
/home/owner/programs/resource_dasm/src/resource_dasm.cc: In function ‘int main(int, char**)’:
/home/owner/programs/resource_dasm/src/resource_dasm.cc:2757:25: error: ‘class ResourceExporter’ has no member named ‘target_ids’; did you mean ‘target_names’?
 2757 |           if (!exporter.target_ids) {
      |                         ^~~~~~~~~~
      |                         target_names
/home/owner/programs/resource_dasm/src/resource_dasm.cc:2758:22: error: ‘class ResourceExporter’ has no member named ‘target_ids’; did you mean ‘target_names’?
 2758 |             exporter.target_ids = ResourceIDs(ResourceIDs::Init::NONE);
      |                      ^~~~~~~~~~
      |                      target_names
/home/owner/programs/resource_dasm/src/resource_dasm.cc:2760:49: error: ‘class ResourceExporter’ has no member named ‘target_ids’; did you mean ‘target_names’?
 2760 |           parse_cli_ids(&argv[x][12], *exporter.target_ids);
      |                                                 ^~~~~~~~~~
      |                                                 target_names
/home/owner/programs/resource_dasm/src/resource_dasm.cc:2762:25: error: ‘class ResourceExporter’ has no member named ‘skip_ids’; did you mean ‘skip_names’?
 2762 |           if (!exporter.skip_ids) {
      |                         ^~~~~~~~
      |                         skip_names
/home/owner/programs/resource_dasm/src/resource_dasm.cc:2763:22: error: ‘class ResourceExporter’ has no member named ‘skip_ids’; did you mean ‘skip_names’?
 2763 |             exporter.skip_ids = ResourceIDs(ResourceIDs::Init::NONE);
      |                      ^~~~~~~~
      |                      skip_names
/home/owner/programs/resource_dasm/src/resource_dasm.cc:2765:49: error: ‘class ResourceExporter’ has no member named ‘skip_ids’; did you mean ‘skip_names’?
 2765 |           parse_cli_ids(&argv[x][10], *exporter.skip_ids);
      |                                                 ^~~~~~~~
      |                                                 skip_names
/home/owner/programs/resource_dasm/src/resource_dasm.cc:2906:18: error: ‘class ResourceExporter’ has no member named ‘target_ids’; did you mean ‘target_names’?
 2906 |         exporter.target_ids.reset();
      |                  ^~~~~~~~~~
      |                  target_names
/home/owner/programs/resource_dasm/src/resource_dasm.cc:2909:18: error: ‘class ResourceExporter’ has no member named ‘skip_ids’; did you mean ‘skip_names’?
 2909 |         exporter.skip_ids.reset();
      |                  ^~~~~~~~
      |                  skip_names
make[2]: *** [CMakeFiles/resource_dasm.dir/build.make:76: CMakeFiles/resource_dasm.dir/src/resource_dasm.cc.o] Error 1
make[1]: *** [CMakeFiles/Makefile2:175: CMakeFiles/resource_dasm.dir/all] Error 2
make: *** [Makefile:136: all] Error 2
PalasX commented 2 years ago

I saw your open PR. I'm confused as how i'd be missing std::optional when using GCC 11.3 and having et(CMAKE_CXX_STANDARD 20) in the CMakeLists.txt

I thought 'optional' was a c++17 feature?

Kristine1975 commented 2 years ago

Right now, resource_dasm doesn't explicitly include optional; instead it is included indirectly by another header.

Or, depending on the standard library, isn't. Which might be the cause of the compile error you're seeing.

PalasX commented 2 years ago

adding #include \<optional> in resource_dasm.cc resolved the build issue there.

And with that, the rest of the project finished building OK!

PalasX commented 2 years ago

thank you for the great amount of assistance! i can confirm it is comiling and running on Ubuntu 22.04.1 MATE LTS Aarch64 (arm64) as a raspberry Pi4.