wghost / UPKUtils

Set of utilities to work with UPK files
GNU General Public License v2.0
58 stars 29 forks source link

Compile errors #16

Open chknatwork opened 1 year ago

chknatwork commented 1 year ago

While compiling a new binary, I encountered the following errors for this command.

UPKUtils

$ninja

> `[2/44] Compiling C++ object libcommon.a.p/LzoUtils.cpp.o
> FAILED: libcommon.a.p/LzoUtils.cpp.o 
> c++ -Ilibcommon.a.p -I. -I.. -fdiagnostics-color=always -D_FILE_OFFSET_BITS=64 -Wall -Winvalid-pch -std=c++14 -O0 -g -fPIC -MD -MQ libcommon.a.p/LzoUtils.cpp.o -MF libcommon.a.p/LzoUtils.cpp.o.d -o libcommon.a.p/LzoUtils.cpp.o -c ../LzoUtils.cpp
> In file included from ../LzoUtils.cpp:1:
> ../LzoUtils.h:8:1: error: ‘uint32_t’ does not name a type
>     8 | uint32_t DecompressLzoCompressedRawData(std::vector<char>& CompressedDataChunk, std::vector<char>& DecompressedDataChunk);
>       | ^~~~~~~~
> ../LzoUtils.h:7:1: note: ‘uint32_t’ is defined in header ‘<cstdint>’; did you forget to ‘#include <cstdint>’?
>     6 | #include <vector>
>   +++ |+#include <cstdint>
>     7 | 
> ../LzoUtils.h:9:1: error: ‘uint32_t’ does not name a type
>     9 | uint32_t DecompressLzoCompressedDataFromStream(std::istream& compressed_stream, std::vector<char>& DecompressedDataChunk);
>       | ^~~~~~~~
> ../LzoUtils.h:9:1: note: ‘uint32_t’ is defined in header ‘<cstdint>’; did you forget to ‘#include <cstdint>’?
> ../LzoUtils.h:10:1: error: ‘uint32_t’ does not name a type
>    10 | uint32_t FindAndDecompressLzoCompressedDataFromStream(std::istream& compressed_stream, uint32_t decompressedSize, std::vector<char>& DecompressedDataChunk);
>       | ^~~~~~~~
> ../LzoUtils.h:10:1: note: ‘uint32_t’ is defined in header ‘<cstdint>’; did you forget to ‘#include <cstdint>’?
> ../LzoUtils.h:11:1: error: ‘uint32_t’ does not name a type
>    11 | uint32_t LzoCompress(std::vector<char>& DataChunk, std::vector<char>& CompressedDataChunk);
>       | ^~~~~~~~
> ../LzoUtils.h:11:1: note: ‘uint32_t’ is defined in header ‘<cstdint>’; did you forget to ‘#include <cstdint>’?
> ../LzoUtils.cpp:18:1: error: ‘uint32_t’ does not name a type
>    18 | uint32_t DecompressLzoCompressedRawData(std::vector<char>& CompressedDataChunk, std::vector<char>& DecompressedDataChunk)
>       | ^~~~~~~~
> ../LzoUtils.cpp:6:1: note: ‘uint32_t’ is defined in header ‘<cstdint>’; did you forget to ‘#include <cstdint>’?
>     5 | #include "minilzo.h"
>   +++ |+#include <cstdint>
>     6 | 
> ../LzoUtils.cpp:108:1: error: ‘uint32_t’ does not name a type
>   108 | uint32_t DecompressLzoCompressedDataFromStream(std::istream& compressed_stream, std::vector<char>& DecompressedDataChunk)
>       | ^~~~~~~~
> ../LzoUtils.cpp:108:1: note: ‘uint32_t’ is defined in header ‘<cstdint>’; did you forget to ‘#include <cstdint>’?
> ../LzoUtils.cpp:195:1: error: ‘uint32_t’ does not name a type
>   195 | uint32_t FindAndDecompressLzoCompressedDataFromStream(std::istream& compressed_stream, uint32_t decompressedSize, std::vector<char>& DecompressedDataChunk)
>       | ^~~~~~~~
> ../LzoUtils.cpp:195:1: note: ‘uint32_t’ is defined in header ‘<cstdint>’; did you forget to ‘#include <cstdint>’?
> ../LzoUtils.cpp:299:1: error: ‘uint32_t’ does not name a type
>   299 | uint32_t LzoCompress(std::vector<char>& DataChunk, std::vector<char>& CompressedDataChunk)
>       | ^~~~~~~~
> ../LzoUtils.cpp:299:1: note: ‘uint32_t’ is defined in header ‘<cstdint>’; did you forget to ‘#include <cstdint>’?
> ../LzoUtils.cpp:13:35: warning: ‘workmem’ defined but not used [-Wunused-variable]
>    13 | static unsigned char __LZO_MMODEL workmem [ LZO1X_1_MEM_COMPRESS ]; /// work memory
>       |                                   ^~~~~~~
> ../LzoUtils.cpp:11:35: warning: ‘out’ defined but not used [-Wunused-variable]
>    11 | static unsigned char __LZO_MMODEL out [ OUT_LEN ];         /// output data
>       |                                   ^~~
> ../LzoUtils.cpp:10:35: warning: ‘in’ defined but not used [-Wunused-variable]
>    10 | static unsigned char __LZO_MMODEL in  [ IN_LEN ];          /// input data
>       |                                   ^~
> [4/44] Compiling C++ object libcommon.a.p/CustomTFC.cpp.o
> FAILED: libcommon.a.p/CustomTFC.cpp.o 
> c++ -Ilibcommon.a.p -I. -I.. -fdiagnostics-color=always -D_FILE_OFFSET_BITS=64 -Wall -Winvalid-pch -std=c++14 -O0 -g -fPIC -MD -MQ libcommon.a.p/CustomTFC.cpp.o -MF libcommon.a.p/CustomTFC.cpp.o.d -o libcommon.a.p/CustomTFC.cpp.o -c ../CustomTFC.cpp
> In file included from ../CustomTFC.cpp:3:
> ../CustomTFC.h:15:5: error: ‘uint32_t’ does not name a type
>    15 |     uint32_t Magic = CUSTOM_TFC_MAGIC;
>       |     ^~~~~~~~
> ../CustomTFC.h:9:1: note: ‘uint32_t’ is defined in header ‘<cstdint>’; did you forget to ‘#include <cstdint>’?
>     8 | #include <fstream>
>   +++ |+#include <cstdint>
>     9 | 
> ../CustomTFC.h:16:5: error: ‘uint32_t’ does not name a type
>    16 |     uint32_t BlockOffset = 0;
>       |     ^~~~~~~~
> ../CustomTFC.h:16:5: note: ‘uint32_t’ is defined in header ‘<cstdint>’; did you forget to ‘#include <cstdint>’?
> ../CustomTFC.h:17:5: error: ‘uint32_t’ does not name a type
>    17 |     uint32_t BlockSize = 16;
>       |     ^~~~~~~~
> ../CustomTFC.h:17:5: note: ‘uint32_t’ is defined in header ‘<cstdint>’; did you forget to ‘#include <cstdint>’?
> ../CustomTFC.h:18:5: error: ‘uint32_t’ does not name a type
>    18 |     uint32_t NextBlockOffset = 0xFFFFFFFF;
>       |     ^~~~~~~~
> ../CustomTFC.h:18:5: note: ‘uint32_t’ is defined in header ‘<cstdint>’; did you forget to ‘#include <cstdint>’?
> ../CustomTFC.h:23:5: error: ‘uint32_t’ does not name a type
>    23 |     uint32_t    SavedBulkDataSizeOnDisk = 0;
>       |     ^~~~~~~~
> ../CustomTFC.h:23:5: note: ‘uint32_t’ is defined in header ‘<cstdint>’; did you forget to ‘#include <cstdint>’?
> ../CustomTFC.h:24:5: error: ‘uint32_t’ does not name a type
>    24 |     uint32_t    SavedBulkDataOffsetInFile = 0xFFFFFFFF;
>       |     ^~~~~~~~
> ../CustomTFC.h:24:5: note: ‘uint32_t’ is defined in header ‘<cstdint>’; did you forget to ‘#include <cstdint>’?
> ../CustomTFC.h:25:5: error: ‘uint32_t’ does not name a type
>    25 |     uint32_t    ObjectNameLength = 0;
>       |     ^~~~~~~~
> ../CustomTFC.h:25:5: note: ‘uint32_t’ is defined in header ‘<cstdint>’; did you forget to ‘#include <cstdint>’?
> ../CustomTFC.h:50:5: error: ‘uint32_t’ does not name a type
>    50 |     uint32_t                                    LastEntryEndOffset = 0;
>       |     ^~~~~~~~
> ../CustomTFC.h:50:5: note: ‘uint32_t’ is defined in header ‘<cstdint>’; did you forget to ‘#include <cstdint>’?
> ../CustomTFC.cpp: In member function ‘bool CustomTFC::Reload()’:
> ../CustomTFC.cpp:76:20: error: ‘struct TFCBlockHeader’ has no member named ‘Magic’
>    76 |         if (header.Magic != CUSTOM_TFC_MAGIC || !TFCFile.good())
>       |                    ^~~~~
> ../CustomTFC.cpp:82:9: error: ‘uint32_t’ was not declared in this scope
>    82 |         uint32_t maxOffset = header.BlockOffset + header.BlockSize;
>       |         ^~~~~~~~
> ../CustomTFC.cpp:4:1: note: ‘uint32_t’ is defined in header ‘<cstdint>’; did you forget to ‘#include <cstdint>’?
>     3 | #include "CustomTFC.h"
>   +++ |+#include <cstdint>
>     4 | 
> ../CustomTFC.cpp:83:34: error: ‘maxOffset’ was not declared in this scope
>    83 |         while (TFCFile.tellg() < maxOffset)
>       |                                  ^~~~~~~~~
> ../CustomTFC.cpp:86:57: error: ‘struct TFCInventoryEntry’ has no member named ‘SavedBulkDataSizeOnDisk’
>    86 |             TFCFile.read(reinterpret_cast<char*>(&entry.SavedBulkDataSizeOnDisk), 4);
>       |                                                         ^~~~~~~~~~~~~~~~~~~~~~~
> ../CustomTFC.cpp:87:57: error: ‘struct TFCInventoryEntry’ has no member named ‘SavedBulkDataOffsetInFile’
>    87 |             TFCFile.read(reinterpret_cast<char*>(&entry.SavedBulkDataOffsetInFile), 4);
>       |                                                         ^~~~~~~~~~~~~~~~~~~~~~~~~
> ../CustomTFC.cpp:88:57: error: ‘struct TFCInventoryEntry’ has no member named ‘ObjectNameLength’; did you mean ‘ObjectName’?
>    88 |             TFCFile.read(reinterpret_cast<char*>(&entry.ObjectNameLength), 4);
>       |                                                         ^~~~~~~~~~~~~~~~
>       |                                                         ObjectName
> ../CustomTFC.cpp:94:27: error: expected ‘)’ before ‘TFCFile’
>    94 |             if ((uint32_t)TFCFile.tellg() + (uint32_t)entry.ObjectNameLength > (uint32_t)maxOffset)
>       |                ~          ^~~~~~~
>       |                           )
> ../CustomTFC.cpp:99:44: error: ‘struct TFCInventoryEntry’ has no member named ‘ObjectNameLength’; did you mean ‘ObjectName’?
>    99 |             std::vector<char> tmpVec(entry.ObjectNameLength);
>       |                                            ^~~~~~~~~~~~~~~~
>       |                                            ObjectName
> ../CustomTFC.cpp:107:76: error: ‘struct TFCInventoryEntry’ has no member named ‘SavedBulkDataSizeOnDisk’
>   107 |             std::string id = entry.ObjectName + "_" + std::to_string(entry.SavedBulkDataSizeOnDisk);
>       |                                                                            ^~~~~~~~~~~~~~~~~~~~~~~
> ../CustomTFC.cpp:110:9: error: ‘LastEntryEndOffset’ was not declared in this scope
>   110 |         LastEntryEndOffset = TFCFile.tellg();
>       |         ^~~~~~~~~~~~~~~~~~
> ../CustomTFC.cpp:111:20: error: ‘struct TFCBlockHeader’ has no member named ‘NextBlockOffset’
>   111 |         if (header.NextBlockOffset != 0xFFFFFFFF)
>       |                    ^~~~~~~~~~~~~~~
> ../CustomTFC.cpp:112:34: error: ‘struct TFCBlockHeader’ has no member named ‘NextBlockOffset’
>   112 |             TFCFile.seekg(header.NextBlockOffset);
>       |                                  ^~~~~~~~~~~~~~~
> ../CustomTFC.cpp: In member function ‘bool CustomTFC::WriteData(TFCInventoryEntry&, std::vector<char>)’:
> ../CustomTFC.cpp:126:46: error: ‘struct TFCInventoryEntry’ has no member named ‘SavedBulkDataSizeOnDisk’
>   126 |     if (DataToWrite.size() == 0 || DataDescr.SavedBulkDataSizeOnDisk != DataToWrite.size())
>       |                                              ^~~~~~~~~~~~~~~~~~~~~~~
> ../CustomTFC.cpp:131:76: error: ‘struct TFCInventoryEntry’ has no member named ‘SavedBulkDataSizeOnDisk’
>   131 |     std::string id = DataDescr.ObjectName + "_" + std::to_string(DataDescr.SavedBulkDataSizeOnDisk);
>       |                                                                            ^~~~~~~~~~~~~~~~~~~~~~~
> ../CustomTFC.cpp:134:19: error: ‘struct TFCInventoryEntry’ has no member named ‘SavedBulkDataOffsetInFile’
>   134 |         DataDescr.SavedBulkDataOffsetInFile = TFCInventory[id].SavedBulkDataOffsetInFile;
>       |                   ^~~~~~~~~~~~~~~~~~~~~~~~~
> ../CustomTFC.cpp:134:64: error: ‘std::map<std::__cxx11::basic_string<char>, TFCInventoryEntry>::mapped_type’ {aka ‘struct TFCInventoryEntry’} has no member named ‘SavedBulkDataOffsetInFile’
>   134 |         DataDescr.SavedBulkDataOffsetInFile = TFCInventory[id].SavedBulkDataOffsetInFile;
>       |                                                                ^~~~~~~~~~~~~~~~~~~~~~~~~
> ../CustomTFC.cpp: In member function ‘bool CustomTFC::InternalWriteData(TFCInventoryEntry&, std::vector<char>)’:
> ../CustomTFC.cpp:155:5: error: ‘uint32_t’ was not declared in this scope
>   155 |     uint32_t newDataOffset = TFCFile.tellg();
>       |     ^~~~~~~~
> ../CustomTFC.cpp:155:5: note: ‘uint32_t’ is defined in header ‘<cstdint>’; did you forget to ‘#include <cstdint>’?
> ../CustomTFC.cpp:156:15: error: ‘struct TFCInventoryEntry’ has no member named ‘SavedBulkDataOffsetInFile’
>   156 |     DataDescr.SavedBulkDataOffsetInFile = newDataOffset;
>       |               ^~~~~~~~~~~~~~~~~~~~~~~~~
> ../CustomTFC.cpp:156:43: error: ‘newDataOffset’ was not declared in this scope
>   156 |     DataDescr.SavedBulkDataOffsetInFile = newDataOffset;
>       |                                           ^~~~~~~~~~~~~
> ../CustomTFC.cpp:177:13: error: expected ‘;’ before ‘newEntryOffset’
>   177 |     uint32_t newEntryOffset = LastEntryEndOffset;
>       |             ^~~~~~~~~~~~~~~
>       |             ;
> ../CustomTFC.cpp:178:15: error: ‘struct TFCInventoryEntry’ has no member named ‘ObjectNameLength’; did you mean ‘ObjectName’?
>   178 |     DataDescr.ObjectNameLength = DataDescr.ObjectName.size();
>       |               ^~~~~~~~~~~~~~~~
>       |               ObjectName
> ../CustomTFC.cpp:179:13: error: expected ‘;’ before ‘newEntrySize’
>   179 |     uint32_t newEntrySize = 12 + DataDescr.ObjectNameLength;
>       |             ^~~~~~~~~~~~~
>       |             ;
> ../CustomTFC.cpp:182:9: error: ‘newEntryOffset’ was not declared in this scope
>   182 |     if (newEntryOffset + newEntrySize >= LastHeader.BlockOffset + ALIGN_TO_BLOCK_SIZE)
>       |         ^~~~~~~~~~~~~~
> ../CustomTFC.cpp:182:26: error: ‘newEntrySize’ was not declared in this scope
>   182 |     if (newEntryOffset + newEntrySize >= LastHeader.BlockOffset + ALIGN_TO_BLOCK_SIZE)
>       |                          ^~~~~~~~~~~~
> ../CustomTFC.cpp:182:53: error: ‘struct TFCBlockHeader’ has no member named ‘BlockOffset’
>   182 |     if (newEntryOffset + newEntrySize >= LastHeader.BlockOffset + ALIGN_TO_BLOCK_SIZE)
>       |                                                     ^~~~~~~~~~~
> ../CustomTFC.cpp:192:19: error: ‘LastEntryEndOffset’ was not declared in this scope
>   192 |     TFCFile.seekp(LastEntryEndOffset);
>       |                   ^~~~~~~~~~~~~~~~~~
> ../CustomTFC.cpp:193:54: error: ‘struct TFCInventoryEntry’ has no member named ‘SavedBulkDataSizeOnDisk’
>   193 |     TFCFile.write(reinterpret_cast<char*>(&DataDescr.SavedBulkDataSizeOnDisk), 4);
>       |                                                      ^~~~~~~~~~~~~~~~~~~~~~~
> ../CustomTFC.cpp:194:54: error: ‘struct TFCInventoryEntry’ has no member named ‘SavedBulkDataOffsetInFile’
>   194 |     TFCFile.write(reinterpret_cast<char*>(&DataDescr.SavedBulkDataOffsetInFile), 4);
>       |                                                      ^~~~~~~~~~~~~~~~~~~~~~~~~
> ../CustomTFC.cpp:195:54: error: ‘struct TFCInventoryEntry’ has no member named ‘ObjectNameLength’; did you mean ‘ObjectName’?
>   195 |     TFCFile.write(reinterpret_cast<char*>(&DataDescr.ObjectNameLength), 4);
>       |                                                      ^~~~~~~~~~~~~~~~
>       |                                                      ObjectName
> ../CustomTFC.cpp:204:76: error: ‘struct TFCInventoryEntry’ has no member named ‘SavedBulkDataSizeOnDisk’
>   204 |     std::string id = DataDescr.ObjectName + "_" + std::to_string(DataDescr.SavedBulkDataSizeOnDisk);
>       |                                                                            ^~~~~~~~~~~~~~~~~~~~~~~
> ../CustomTFC.cpp:207:16: error: ‘struct TFCBlockHeader’ has no member named ‘BlockSize’
>   207 |     LastHeader.BlockSize += newEntrySize;
>       |                ^~~~~~~~~
> ../CustomTFC.cpp:207:29: error: ‘newEntrySize’ was not declared in this scope
>   207 |     LastHeader.BlockSize += newEntrySize;
>       |                             ^~~~~~~~~~~~
> ../CustomTFC.cpp:208:30: error: ‘struct TFCBlockHeader’ has no member named ‘BlockOffset’
>   208 |     TFCFile.seekp(LastHeader.BlockOffset + 8);
>       |                              ^~~~~~~~~~~
> ../CustomTFC.cpp:209:55: error: ‘struct TFCBlockHeader’ has no member named ‘BlockSize’
>   209 |     TFCFile.write(reinterpret_cast<char*>(&LastHeader.BlockSize), 4);
>       |                                                       ^~~~~~~~~
> ../CustomTFC.cpp: In member function ‘bool CustomTFC::InternalWriteNewBlock()’:
> ../CustomTFC.cpp:217:5: error: ‘uint32_t’ was not declared in this scope
>   217 |     uint32_t newBlockOffset = TFCFile.tellg();
>       |     ^~~~~~~~
> ../CustomTFC.cpp:217:5: note: ‘uint32_t’ is defined in header ‘<cstdint>’; did you forget to ‘#include <cstdint>’?
> ../CustomTFC.cpp:219:37: error: ‘newBlockOffset’ was not declared in this scope
>   219 |     if (BlockHeaders.size() == 0 && newBlockOffset != 0)
>       |                                     ^~~~~~~~~~~~~~
> ../CustomTFC.cpp:225:19: error: ‘newBlockOffset’ was not declared in this scope
>   225 |     TFCFile.seekp(newBlockOffset);
>       |                   ^~~~~~~~~~~~~~
> ../CustomTFC.cpp:236:61: error: ‘__gnu_cxx::__alloc_traits<std::allocator<TFCBlockHeader>, TFCBlockHeader>::value_type’ {aka ‘struct TFCBlockHeader’} has no member named ‘BlockOffset’
>   236 |         TFCFile.seekp(BlockHeaders[BlockHeaders.size() - 1].BlockOffset + 12);
>       |                                                             ^~~~~~~~~~~
> ../CustomTFC.cpp:246:15: error: ‘struct TFCBlockHeader’ has no member named ‘BlockOffset’
>   246 |     NewHeader.BlockOffset = newBlockOffset;
>       |               ^~~~~~~~~~~
> ../CustomTFC.cpp:255:5: error: ‘LastEntryEndOffset’ was not declared in this scope
>   255 |     LastEntryEndOffset = TFCFile.tellp();
>       |     ^~~~~~~~~~~~~~~~~~
> [11/44] Compiling C++ object libcommon.a.p/UObject.cpp.o
> ninja: build stopped: subcommand failed.
> `

Not sure how if this needs an update or I made a mistake.

mirh commented 1 year ago

https://github.com/bogsen/UPKUtilsAndroid/commit/07231987bccfd80caa796e5fffddd96dec0be314 https://stackoverflow.com/questions/11069108/uint32-t-does-not-name-a-type

chknatwork commented 1 year ago

If it helps, I currently have wxwidgets 3.2.2.1, Ninja 1.11.1, Meson 1.2.1, Cmake 3.27.6, and gcc 13.2.1 installed from EndeavourOS repo and the AUR.

mirh commented 1 year ago

IIRC I was just good with cmake and msvc. Maybe give a check to the other forks contributions.

chknatwork commented 1 year ago

IIRC I was just good with cmake and msvc. Maybe give a check to the other forks contributions.

I assume msvc is part of Windows development. I guess you mean you were able to compile it under Windows?

tflucke commented 1 year ago

I'm also having issues on Arch Linux:

-- Generating done (0.0s)
-- Build files have been written to: /space/tom/.yay-builds/patchergui/src/patchergui/UPKUtils/build
[  2%] Building CXX object CMakeFiles/ModParser.dir/space/tom/.yay-builds/patchergui/src/patchergui/UPKUtils/ModParser.cpp.o
/space/tom/.yay-builds/patchergui/src/patchergui/UPKUtils/ModParser.cpp: In function ‘std::string MakeTextBlock(char*, size_t)’:
/space/tom/.yay-builds/patchergui/src/patchergui/UPKUtils/ModParser.cpp:50:9: error: ‘uint8_t’ was not declared in this scope
   50 |         uint8_t ch = data[i];
      |         ^~~~~~~
/space/tom/.yay-builds/patchergui/src/patchergui/UPKUtils/ModParser.cpp:7:1: note: ‘uint8_t’ is defined in header ‘<cstdint>’; did you forget to ‘#include <cstdint>’?
    6 | #include <cctype>
  +++ |+#include <cstdint>
    7 | 
/space/tom/.yay-builds/patchergui/src/patchergui/UPKUtils/ModParser.cpp:51:16: error: expected ‘;’ before ‘up’
   51 |         uint8_t up = ((ch & 0xF0) >> 4);
      |                ^~~
      |                ;
/space/tom/.yay-builds/patchergui/src/patchergui/UPKUtils/ModParser.cpp:52:16: error: expected ‘;’ before ‘lw’
   52 |         uint8_t lw =  (ch & 0x0F);
      |                ^~~
      |                ;
/space/tom/.yay-builds/patchergui/src/patchergui/UPKUtils/ModParser.cpp:53:25: error: ‘up’ was not declared in this scope
   53 |         out += chLookup[up];
      |                         ^~
/space/tom/.yay-builds/patchergui/src/patchergui/UPKUtils/ModParser.cpp:54:25: error: ‘lw’ was not declared in this scope
   54 |         out += chLookup[lw];
      |                         ^~

Adding #include <cstdint> to ModParser.cpp seems to fix the compile issues, but then I get these linking errors:

[ 55%] Linking CXX executable CompareUPK
/usr/bin/ld: libUPKInfo.a(UPKInfo.cpp.o): in function `UPKInfo::FormatName[abi:cxx11](unsigned int, bool)':
UPKInfo.cpp:(.text+0x1c0e): undefined reference to `FormatHEX[abi:cxx11](unsigned int)'
/usr/bin/ld: UPKInfo.cpp:(.text+0x1c7b): undefined reference to `FormatHEX[abi:cxx11](char*, unsigned long)'
/usr/bin/ld: UPKInfo.cpp:(.text+0x1d5b): undefined reference to `FormatHEX[abi:cxx11](unsigned int)'
/usr/bin/ld: UPKInfo.cpp:(.text+0x1dd5): undefined reference to `FormatHEX[abi:cxx11](unsigned int)'
/usr/bin/ld: libUPKInfo.a(UPKInfo.cpp.o): in function `UPKInfo::FormatCompressedHeader[abi:cxx11]()':
UPKInfo.cpp:(.text+0x2707): undefined reference to `FormatHEX[abi:cxx11](unsigned int)'
/usr/bin/ld: libUPKInfo.a(UPKInfo.cpp.o): in function `UPKInfo::FormatSummary[abi:cxx11]()':
UPKInfo.cpp:(.text+0x30f0): undefined reference to `FormatHEX[abi:cxx11](unsigned int)'
/usr/bin/ld: UPKInfo.cpp:(.text+0x3263): undefined reference to `FormatHEX[abi:cxx11](unsigned int)'
/usr/bin/ld: libUPKInfo.a(UPKInfo.cpp.o):UPKInfo.cpp:(.text+0x336a): more undefined references to `FormatHEX[abi:cxx11](unsigned int)' follow
/usr/bin/ld: libUPKInfo.a(UPKInfo.cpp.o): in function `UPKInfo::FormatSummary[abi:cxx11]()':
UPKInfo.cpp:(.text+0x33de): undefined reference to `FormatPackageFlags[abi:cxx11](unsigned int)'
/usr/bin/ld: UPKInfo.cpp:(.text+0x348b): undefined reference to `FormatHEX[abi:cxx11](unsigned int)'
/usr/bin/ld: UPKInfo.cpp:(.text+0x3577): undefined reference to `FormatHEX[abi:cxx11](unsigned int)'
/usr/bin/ld: UPKInfo.cpp:(.text+0x3663): undefined reference to `FormatHEX[abi:cxx11](unsigned int)'
/usr/bin/ld: UPKInfo.cpp:(.text+0x36ec): undefined reference to `FormatHEX[abi:cxx11](unsigned int)'
/usr/bin/ld: UPKInfo.cpp:(.text+0x3775): undefined reference to `FormatHEX[abi:cxx11](unsigned int)'
/usr/bin/ld: libUPKInfo.a(UPKInfo.cpp.o):UPKInfo.cpp:(.text+0x37f9): more undefined references to `FormatHEX[abi:cxx11](unsigned int)' follow
/usr/bin/ld: libUPKInfo.a(UPKInfo.cpp.o): in function `UPKInfo::FormatSummary[abi:cxx11]()':
UPKInfo.cpp:(.text+0x3f62): undefined reference to `FormatCompressionFlags[abi:cxx11](unsigned int)'
/usr/bin/ld: UPKInfo.cpp:(.text+0x40f3): undefined reference to `FormatHEX[abi:cxx11](unsigned int)'
/usr/bin/ld: UPKInfo.cpp:(.text+0x4269): undefined reference to `FormatHEX[abi:cxx11](unsigned int)'
/usr/bin/ld: UPKInfo.cpp:(.text+0x452e): undefined reference to `FormatHEX[abi:cxx11](std::vector<char, std::allocator<char> >)'
/usr/bin/ld: libUPKInfo.a(UPKInfo.cpp.o): in function `UPKInfo::FormatImport[abi:cxx11](unsigned int, bool)':
UPKInfo.cpp:(.text+0x8175): undefined reference to `FormatHEX[abi:cxx11](unsigned int)'
/usr/bin/ld: UPKInfo.cpp:(.text+0x81ef): undefined reference to `FormatHEX[abi:cxx11](char*, unsigned long)'
/usr/bin/ld: UPKInfo.cpp:(.text+0x8593): undefined reference to `FormatHEX[abi:cxx11](unsigned int)'
/usr/bin/ld: libUPKInfo.a(UPKInfo.cpp.o): in function `UPKInfo::FormatExport[abi:cxx11](unsigned int, bool)':
UPKInfo.cpp:(.text+0x91a1): undefined reference to `FormatHEX[abi:cxx11](unsigned int)'
/usr/bin/ld: UPKInfo.cpp:(.text+0x921c): undefined reference to `FormatHEX[abi:cxx11](char*, unsigned long)'
/usr/bin/ld: UPKInfo.cpp:(.text+0x935f): undefined reference to `FormatHEX[abi:cxx11](unsigned int)'
/usr/bin/ld: UPKInfo.cpp:(.text+0x943d): undefined reference to `FormatHEX[abi:cxx11](unsigned int)'
/usr/bin/ld: UPKInfo.cpp:(.text+0x951a): undefined reference to `FormatHEX[abi:cxx11](unsigned int)'
/usr/bin/ld: UPKInfo.cpp:(.text+0x9711): undefined reference to `FormatHEX[abi:cxx11](unsigned int)'
/usr/bin/ld: UPKInfo.cpp:(.text+0x9902): undefined reference to `FormatHEX[abi:cxx11](unsigned int)'
/usr/bin/ld: UPKInfo.cpp:(.text+0x996b): undefined reference to `FormatObjectFlagsH[abi:cxx11](unsigned int)'
/usr/bin/ld: UPKInfo.cpp:(.text+0x99ae): undefined reference to `FormatHEX[abi:cxx11](unsigned int)'
/usr/bin/ld: UPKInfo.cpp:(.text+0x9a1a): undefined reference to `FormatObjectFlagsL[abi:cxx11](unsigned int)'
/usr/bin/ld: UPKInfo.cpp:(.text+0x9a60): undefined reference to `FormatHEX[abi:cxx11](unsigned int)'
/usr/bin/ld: UPKInfo.cpp:(.text+0x9b1b): undefined reference to `FormatHEX[abi:cxx11](unsigned int)'
/usr/bin/ld: UPKInfo.cpp:(.text+0x9b99): undefined reference to `FormatHEX[abi:cxx11](unsigned int)'
/usr/bin/ld: UPKInfo.cpp:(.text+0x9c02): undefined reference to `FormatExportFlags[abi:cxx11](unsigned int)'
/usr/bin/ld: UPKInfo.cpp:(.text+0x9d2d): undefined reference to `FormatHEX[abi:cxx11](unsigned int)'
/usr/bin/ld: UPKInfo.cpp:(.text+0x9f4e): undefined reference to `FormatHEX[abi:cxx11](unsigned int)'
/usr/bin/ld: UPKInfo.cpp:(.text+0xa4d2): undefined reference to `FormatHEX[abi:cxx11](unsigned int)'
collect2: error: ld returned 1 exit status
make[2]: *** [CMakeFiles/CompareUPK.dir/build.make:98: CompareUPK] Error 1
make[1]: *** [CMakeFiles/Makefile2:351: CMakeFiles/CompareUPK.dir/all] Error 2
make: *** [Makefile:91: all] Error 2

Unfortunately, I don't know CMake very well so I'm not sure how to debug this.

tecknogyk commented 6 months ago

I was able to fix this issue by adding #include <cstdint> to the following files: ModParser.h, LzoUtils.h, CustomTFC.h, and UENativeTablesReader.cpp

chknatwork commented 5 months ago

I was able to fix this issue by adding #include <cstdint> to the following files: ModParser.h, LzoUtils.h, CustomTFC.h, and UENativeTablesReader.cpp

Was able to compile using cmake and make commands. For some reason, using ninja doesn't work.

Despite a successful compile on the binaries, I get an xcomgame.upk error. The logs show an unexpected error occurred.

BrettRyland commented 1 month ago

Looking at the debug log, it looks like the commandline options for DecompressLZO has changed. Commenting out line 769 of PatcherGUIMain.cpp, i.e.,

diff --git a/src/PatcherGUIMain.cpp b/src/PatcherGUIMain.cpp
index 179e348..3c0db1f 100644
--- a/src/PatcherGUIMain.cpp
+++ b/src/PatcherGUIMain.cpp
@@ -766,7 +766,7 @@ bool PatcherGUIFrame::DecompressUPK()
     {
         long retVal = 0;
         wxString executeDecompressCommandLineString = "\"" + DecompressProgram + "\"";
-        executeDecompressCommandLineString += " \"" + FilesToDecompress[i] + "\"";
+        // executeDecompressCommandLineString += " \"" + FilesToDecompress[i] + "\"";
         executeDecompressCommandLineString += " \"" + TextCtrl1->GetValue() + COOKED_DIR + "/" + FilesToDecompress[i] + "\"";

         wxExecuteEnv env;

(in addition to the above additions of #include <cstdint>) seems to allow PatcherGUI to work again. (At least, it claims to have successfully applied the patches I use, but I haven't actually run XCOM to test it yet and seems to be working correctly.)