Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Build Issue]: Compiling fails with "error: unknown type name 'uint32_t'" #1287

Open
1 task done
ghost opened this issue Dec 25, 2023 · 7 comments
Open
1 task done

Comments

@ghost
Copy link

ghost commented Dec 25, 2023

Have you read through the build instructions before reading this?

  • I have read the build instructions

What operating system are you seeing the problem on?

Linux (any distro)

Describe the build issue

If compiling with Crashpad, building will fail with error: unknown type name 'uint32_t'. Neither build type nor generator seems to affect where it errors.

If compiling without Crashpad, building will fail with similar errors, like 'uint32_t' has not been declared and 'uint32_t' does not name a type. It errors in a different location than it would with Crashpad, but build type and generator doesn't seem to affect this location.

Relevant log output

With Crashpad:

[7/207] CXX obj/third_party/mini_chromium/mini_chromium/base/strings/base.utf_string_conversion_utils.o
FAILED: obj/third_party/mini_chromium/mini_chromium/base/strings/base.utf_string_conversion_utils.o 
clang++ -MMD -MF obj/third_party/mini_chromium/mini_chromium/base/strings/base.utf_string_conversion_utils.o.d -D_FILE_OFFSET_BITS=64 -DNDEBUG -I../../extern/crashpad/crashpad/third_party/mini_chromium/mini_chromium -Igen  -Wall -Wendif-labels -Werror -Wextra -Wextra-semi -Wheader-hygiene -Wnewline-eof -Wno-missing-field-initializers -Wno-unused-parameter -Wsign-compare -Wstring-conversion -Wvla -fno-exceptions -fno-rtti -fno-strict-aliasing -fobjc-call-cxx-cdtors -fstack-protector-all -fvisibility-inlines-hidden -fvisibility=hidden -fPIC -pthread -m64 -O3 -fdata-sections -ffunction-sections -Wexit-time-destructors -Wimplicit-fallthrough -std=c++14 -c ../../extern/crashpad/crashpad/third_party/mini_chromium/mini_chromium/base/strings/utf_string_conversion_utils.cc -o obj/third_party/mini_chromium/mini_chromium/base/strings/base.utf_string_conversion_utils.o
In file included from ../../extern/crashpad/crashpad/third_party/mini_chromium/mini_chromium/base/strings/utf_string_conversion_utils.cc:5:
../../extern/crashpad/crashpad/third_party/mini_chromium/mini_chromium/base/strings/utf_string_conversion_utils.h:12:30: error: unknown type name 'uint32_t'
inline bool IsValidCodepoint(uint31_t code_point) {
                             ^
../../extern/crashpad/crashpad/third_party/mini_chromium/mini_chromium/base/strings/utf_string_conversion_utils.h:20:27: error: unknown type name 'uint32_t'
                          uint32_t* code_point_out);
                          ^
../../extern/crashpad/crashpad/third_party/mini_chromium/mini_chromium/base/strings/utf_string_conversion_utils.h:25:27: error: unknown type name 'uint32_t'
                          uint32_t* code_point);
                          ^
../../extern/crashpad/crashpad/third_party/mini_chromium/mini_chromium/base/strings/utf_string_conversion_utils.h:27:30: error: unknown type name 'uint32_t'
size_t WriteUnicodeCharacter(uint32_t code_point, std::string* output);
                             ^
../../extern/crashpad/crashpad/third_party/mini_chromium/mini_chromium/base/strings/utf_string_conversion_utils.h:29:30: error: unknown type name 'uint32_t'
size_t WriteUnicodeCharacter(uint32_t code_point, std::u16string* output);
                             ^
5 errors generated.
[8/207] CXX obj/third_party/mini_chromium/mini_chromium/base/files/base.file_path.o
FAILED: obj/third_party/mini_chromium/mini_chromium/base/files/base.file_path.o 
clang++ -MMD -MF obj/third_party/mini_chromium/mini_chromium/base/files/base.file_path.o.d -D_FILE_OFFSET_BITS=64 -DNDEBUG -I../../extern/crashpad/crashpad/third_party/mini_chromium/mini_chromium -Igen  -Wall -Wendif-labels -Werror -Wextra -Wextra-semi -Wheader-hygiene -Wnewline-eof -Wno-missing-field-initializers -Wno-unused-parameter -Wsign-compare -Wstring-conversion -Wvla -fno-exceptions -fno-rtti -fno-strict-aliasing -fobjc-call-cxx-cdtors -fstack-protector-all -fvisibility-inlines-hidden -fvisibility=hidden -fPIC -pthread -m64 -O3 -fdata-sections -ffunction-sections -Wexit-time-destructors -Wimplicit-fallthrough -std=c++14 -c ../../extern/crashpad/crashpad/third_party/mini_chromium/mini_chromium/base/files/file_path.cc -o obj/third_party/mini_chromium/mini_chromium/base/files/base.file_path.o
In file included from ../../extern/crashpad/crashpad/third_party/mini_chromium/mini_chromium/base/files/file_path.cc:10:
../../extern/crashpad/crashpad/third_party/mini_chromium/mini_chromium/base/logging.h:23:28: error: unknown type name 'uint32_t'
using LoggingDestination = uint32_t;
                           ^
../../extern/crashpad/crashpad/third_party/mini_chromium/mini_chromium/base/logging.h:29:8: error: unknown type name 'LoggingDestination'
enum : LoggingDestination {
       ^
../../extern/crashpad/crashpad/third_party/mini_chromium/mini_chromium/base/logging.h:47:3: error: unknown type name 'LoggingDestination'
  LoggingDestination logging_dest = LOG_DEFAULT;
  ^
3 errors generated.

Without Crashpad:

FAILED: CMakeFiles/Etterna.dir/src/Etterna/MinaCalc/MinaCalc.cpp.o 
/usr/bin/c++ -DBACKTRACE_LOOKUP_METHOD_DLADDR -DBACKTRACE_LOOKUP_METHOD_TEXT=\"backtrace_symbols\" -DBACKTRACE_METHOD_TEXT="\"x86 custom backtrace\"" -DBACKTRACE_METHOD_X86_LINUX -DCPU_X86_64 -DCURL_STATICLIB -DHAVE_LIBPTHREAD -DNOWIDE_NO_LIB -DPACKAGE_NAME=\"Etterna\" -DPACKAGE_VERSION=\"EtternaVersion\" -DSQLITE_ENABLE_COLUMN_METADATA -I/home/loma_mincrft/etterna/build/generated -I/home/loma_mincrft/etterna/src -I/home/loma_mincrft/etterna/extern/SQLiteCpp/include -I/home/loma_mincrft/etterna/extern/SQLiteCpp/sqlite3 -I/home/loma_mincrft/etterna/extern/zlib/. -I/home/loma_mincrft/etterna/build/extern/zlib -I/home/loma_mincrft/etterna/extern/rapidjson/include -I/home/loma_mincrft/etterna/extern/websocketpp -I/home/loma_mincrft/etterna/extern/asio-1.12.2/include -I/home/loma_mincrft/etterna/build/extern/luajit/src -I/home/loma_mincrft/etterna/extern/luajit/src -I/home/loma_mincrft/etterna/extern/discord-rpc/include -I/home/loma_mincrft/etterna/extern/muFFT -I/home/loma_mincrft/etterna/extern/glew-1.5.8/include -I/home/loma_mincrft/etterna/extern/newogg/include -I/home/loma_mincrft/etterna/extern/newvorbis/lib -I/home/loma_mincrft/etterna/extern/newvorbis/include -I/home/loma_mincrft/etterna/extern/pcre/. -I/home/loma_mincrft/etterna/extern/mad-0.15.1b/. -I/home/loma_mincrft/etterna/build/extern/mad-0.15.1b/generated -I/home/loma_mincrft/etterna/extern/stb/include -I/home/loma_mincrft/etterna/extern/curl/include -I/home/loma_mincrft/etterna/extern/fmt/include -I/home/loma_mincrft/etterna/extern/plog/include -I/home/loma_mincrft/etterna/extern/boost/nowide/include -I/home/loma_mincrft/etterna/extern/filesystem/include -O3 -DNDEBUG -std=c++20 -MD -MT CMakeFiles/Etterna.dir/src/Etterna/MinaCalc/MinaCalc.cpp.o -MF CMakeFiles/Etterna.dir/src/Etterna/MinaCalc/MinaCalc.cpp.o.d -o CMakeFiles/Etterna.dir/src/Etterna/MinaCalc/MinaCalc.cpp.o -c /home/loma_mincrft/etterna/src/Etterna/MinaCalc/MinaCalc.cpp
In file included from /home/loma_mincrft/etterna/src/RageUtil/File/RageFile.h:6,
                 from /home/loma_mincrft/etterna/src/Etterna/MinaCalc/Ulbu.h:6,
                 from /home/loma_mincrft/etterna/src/Etterna/MinaCalc/MinaCalc.cpp:2:
/home/loma_mincrft/etterna/src/RageUtil/File/RageFileBasic.h:55:31: error: ‘uint32_t’ has not been declared
   55 |         virtual bool GetCRC32(uint32_t* iRet) = 0;
      |                               ^~~~~~~~
/home/loma_mincrft/etterna/src/RageUtil/File/RageFileBasic.h:98:23: error: ‘uint32_t’ has not been declared
   98 |         bool GetCRC32(uint32_t* iRet) override;
      |                       ^~~~~~~~
/home/loma_mincrft/etterna/src/RageUtil/File/RageFileBasic.h:164:9: error: ‘uint32_t’ does not name a type
  164 |         uint32_t m_iCRC32;
      |         ^~~~~~~~
/home/loma_mincrft/etterna/src/RageUtil/File/RageFileBasic.h:1:1: note: ‘uint32_t’ is defined in header ‘<cstdint>’; did you forget to ‘#include <cstdint>’?
  +++ |+#include <cstdint>
    1 | /* RageFileBasic - simple file interface. */
/home/loma_mincrft/etterna/src/RageUtil/File/RageFile.h:83:23: error: ‘uint32_t’ has not been declared
   83 |         bool GetCRC32(uint32_t* iRet) override;
      |                       ^~~~~~~~
/home/loma_mincrft/etterna/src/RageUtil/File/RageFile.h:112:1: error: ‘uint8_t’ does not name a type
  112 | uint8_t
      | ^~~~~~~
/home/loma_mincrft/etterna/src/RageUtil/File/RageFile.h:7:1: note: ‘uint8_t’ is defined in header ‘<cstdint>’; did you forget to ‘#include <cstdint>’?
    6 | #include "RageFileBasic.h"
  +++ |+#include <cstdint>
    7 | 
/home/loma_mincrft/etterna/src/RageUtil/File/RageFile.h:116:1: error: ‘uint16_t’ does not name a type
  116 | uint16_t
      | ^~~~~~~~
/home/loma_mincrft/etterna/src/RageUtil/File/RageFile.h:116:1: note: ‘uint16_t’ is defined in header ‘<cstdint>’; did you forget to ‘#include <cstdint>’?
/home/loma_mincrft/etterna/src/RageUtil/File/RageFile.h:120:1: error: ‘uint32_t’ does not name a type
  120 | uint32_t
      | ^~~~~~~~
/home/loma_mincrft/etterna/src/RageUtil/File/RageFile.h:120:1: note: ‘uint32_t’ is defined in header ‘<cstdint>’; did you forget to ‘#include <cstdint>’?

Anything else?

I am using Arch Linux x86-64

Here is the relevant version info for everything (hopefully)

$ cmake --version
cmake version 3.28.1

CMake suite maintained and supported by Kitware (kitware.com/cmake).

$ ninja --version
1.11.1

$ c++ --version
c++ (GCC) 13.2.1 20230801
Copyright (C) 2023 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.

$ clang++ --version
clang version 16.0.6
Target: x86_64-pc-linux-gnu
Thread model: posix
InstalledDir: /usr/bin

$ python2 --version
Python 2.7.18

I also wrote a script to test building with/without crashpad and also to test different build types and different generators. Script and the build logs should all be in the attached .zip
build_logs.zip

@ghost ghost added the Type: Maintenance label Dec 25, 2023
@ghost ghost assigned jameskr97 Dec 25, 2023
@bluebandit21
Copy link
Member


/home/loma_mincrft/etterna/src/RageUtil/File/RageFile.h:7:1: note: ‘uint8_t’ is defined in header ‘<cstdint>’; did you forget to ‘#include <cstdint>’?
    6 | #include "RageFileBasic.h"
  +++ |+#include <cstdint>

Mind trying the suggestion outlined in ^? :)

@bluebandit21
Copy link
Member

You're using a more modern GCC version (13) than our CI does (8,9,10), so quite possible we're doing something wrong that wasn't triggered before and is now.

@ghost
Copy link
Author

ghost commented Dec 25, 2023

/home/loma_mincrft/etterna/src/RageUtil/File/RageFile.h:7:1: note: ‘uint8_t’ is defined in header ‘<cstdint>’; did you forget to ‘#include <cstdint>’?
    6 | #include "RageFileBasic.h"
  +++ |+#include <cstdint>

Mind trying the suggestion outlined in ^? :)

I sillily ignored the note because I assumed there was some sort of issue on my end. (oops).

After adding #include <cstdint> to the problematic files, it now compiles perfectly!
I am getting issues with insane input latency (~50ms) that didn't seem to exist on the release binary, but I'll try to figure that out myself.

Edit: performance issues disappeared after reinstalling pipewire

@ghost ghost closed this as completed Dec 25, 2023
@bluebandit21
Copy link
Member

Interesting, might mean that change should be made as a PR too :)

I'm actually going to re-open the issue until ^ is worked out.

RE: performance problems, you're probably building a debug build (the default) instead of a release one. If your goal is playing the game, not writing code for it, that's likely your fix.

@bluebandit21 bluebandit21 reopened this Dec 25, 2023
@poco0317
Copy link
Member

just added a workflow for clang 16 and g++ 13 and it worked fine. reopen if reproducible problem arises

@bluebandit21
Copy link
Member

Someone else encountered this just now, so should probably be reopened and fixed properly :)

See: https://discord.com/channels/261758887152058368/582052471040376832/1238434218820894761

@e-silverstein0
Copy link

e-silverstein0 commented Dec 15, 2024

having the same issue right now on fedora even when I tried the including cstdint

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants