afritz1 / OpenTESArena

Open-source re-implementation of The Elder Scrolls: Arena.
MIT License
987 stars 68 forks source link

Fixed ‘uint64_t’ does not name a type error preventing building on linux #256

Closed IcePanorama closed 7 months ago

IcePanorama commented 7 months ago

Hello! I was attempting to build this project from scratch in order to make a contribution and I ran across this error while running make. Just made this simple, one-line fix for it and I was able to build the project without any issues.

afritz1 commented 7 months ago

The original code compiles fine on my sw-renderer-redesign-part-3 branch on like four flavors of Linux and on macOS. You should try that branch.

IcePanorama commented 7 months ago

Just tried building it again on Fedora 39/Kernel: 6.7.4-200.fc39.x86_64, this time on that branch, but the issue still persists for me.

$ cmake -DCMAKE_BUILD_TYPE=Debug ..
-- The C compiler identification is GNU 13.2.1
-- The CXX compiler identification is GNU 13.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
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD - Success
-- Found Threads: TRUE  
-- Found SDL2: /usr/lib64/libSDL2main.a;/usr/lib64/libSDL2.so  
-- Found OpenAL: /usr/lib64/libopenal.so  
-- Found WildMidi: /usr/lib64/libWildMidi.so  
-- Configuring done (0.5s)
-- Generating done (0.0s)
-- Build files have been written to: /home/[username]/Games/Open TESA/OpenTESArena/build
$ make -j8
[  1%] Building CXX object components/CMakeFiles/components.dir/utilities/Directory.cpp.o
[  1%] Building CXX object components/CMakeFiles/components.dir/utilities/Bytes.cpp.o
[  1%] Building CXX object components/CMakeFiles/components.dir/archives/archive.cpp.o
[  1%] Building CXX object components/CMakeFiles/components.dir/utilities/File.cpp.o
[  1%] Building CXX object components/CMakeFiles/components.dir/debug/Debug.cpp.o
[  1%] Building CXX object components/CMakeFiles/components.dir/archives/bsaarchive.cpp.o
[  2%] Building CXX object components/CMakeFiles/components.dir/utilities/FPSCounter.cpp.o
[  2%] Building CXX object components/CMakeFiles/components.dir/utilities/HexPrinter.cpp.o
[  2%] Building CXX object components/CMakeFiles/components.dir/utilities/KeyValueFile.cpp.o
[  3%] Building CXX object components/CMakeFiles/components.dir/utilities/Path.cpp.o
[  3%] Building CXX object components/CMakeFiles/components.dir/utilities/Profiler.cpp.o
[  3%] Building CXX object components/CMakeFiles/components.dir/utilities/String.cpp.o
[  4%] Building CXX object components/CMakeFiles/components.dir/utilities/StringView.cpp.o
[  4%] Building CXX object components/CMakeFiles/components.dir/utilities/TextLinesFile.cpp.o
[  4%] Building CXX object components/CMakeFiles/components.dir/utilities/VirtualHeap.cpp.o
[  5%] Building CXX object components/CMakeFiles/components.dir/vfs/manager.cpp.o
In file included from /home/[username]/Games/Open TESA/OpenTESArena/components/utilities/VirtualHeap.cpp:4:
/home/[username]/Games/Open TESA/OpenTESArena/components/utilities/VirtualHeap.h:19:32: error: ‘uint64_t’ does not name a type
   19 |                 using Offset = uint64_t;
      |                                ^~~~~~~~
... [more errors related to Offset below] ...

working C compiler and working CXX compiler both show up as skipped (which I honestly don't know if that's normal or not--I'm new to open source stuff, forgive me), but if I run cc and c++ separately, they both work as expected, so I don't believe that is the issue.

$ cc
cc: fatal error: no input files
compilation terminated.
$ c++
c++: fatal error: no input files
compilation terminated.

This could just be a weird, one-off issue with my particular install of Linux, but if have a few minutes in the future, maybe try including <cstdint> into components/utilities/VirtualHeap.h and seeing if you have any issues either during or after building.

Sorry for originally posting a reply and then deleting immediately deleting it--I realized after writing that response that I had never switched branches before trying to build again lol

If you'd prefer, I could open a new issue and close this pull request. Just let me know and I'll be happy to oblige.

afritz1 commented 7 months ago

Nah it's fine, it's just that I've fixed include errors for GCC like a hundred times on this engine so this is nothing new.

afritz1 commented 7 months ago

I can try adding a Fedora VM to my list of systems to check. Is your setup unusual at all or should I just get the first ISO I see on the Fedora site?

IcePanorama commented 7 months ago

I'm using the i3 WM spin version.

afritz1 commented 7 months ago

It took a few tries but I got that installed and the engine compiled with latest main.