Archlinux上build时报错
mland2333 opened this issue · 3 comments
Bug描述
Archlinux上执行./build_linux.sh debug时,出现了类型错误
命令提示:
-- Using X11 for window creation
-- Build spdlog: 1.9.2
-- Build type: Debug
CMake Deprecation Warning at engine/3rdparty/tinyobjloader/CMakeLists.txt:5 (cmake_minimum_required):
Compatibility with CMake < 3.5 will be removed from a future version of
CMake.
Update the VERSION argument value or use a ... suffix to tell
CMake that the project does not need compatibility with older versions.
-- Configuring done (0.1s)
-- Generating done (0.0s)
-- Build files have been written to: /home/mland/my/games104/Piccolo/build
[0/2] Re-checking globbed directories...
[1/231] Building CXX object engine/3rdparty/JoltPhysics/Build/CMakeFiles/Jolt.dir//Jolt/Core/Memory.cpp.o
FAILED: engine/3rdparty/JoltPhysics/Build/CMakeFiles/Jolt.dir//Jolt/Core/Memory.cpp.o
/usr/bin/clang++ -DJPH_DEBUG_RENDERER -DJPH_PROFILE_ENABLED -DPICCOLO_VK_LAYER_PATH=/home/mland/my/games104/Piccolo/engine/3rdparty/VulkanSDK/bin/Linux -D_DEBUG -I/home/mland/my/games104/Piccolo/engine/3rdparty/JoltPhysics/Build/.. -g -std=c++17 -I. -Wall -Werror -mavx2 -mbmi -mpopcnt -mlzcnt -mf16c -mfma -mlzcnt -mbmi -mf16c -mfma -g -std=gnu++17 -Wno-unqualified-std-cast-call -MD -MT engine/3rdparty/JoltPhysics/Build/CMakeFiles/Jolt.dir//Jolt/Core/Memory.cpp.o -MF engine/3rdparty/JoltPhysics/Build/CMakeFiles/Jolt.dir//Jolt/Core/Memory.cpp.o.d -o engine/3rdparty/JoltPhysics/Build/CMakeFiles/Jolt.dir/__/Jolt/Core/Memory.cpp.o -c /home/mland/my/games104/Piccolo/engine/3rdparty/JoltPhysics/Jolt/Core/Memory.cpp
In file included from /home/mland/my/games104/Piccolo/engine/3rdparty/JoltPhysics/Jolt/Core/Memory.cpp:4:
In file included from /home/mland/my/games104/Piccolo/engine/3rdparty/JoltPhysics/Build/../Jolt/Jolt.h:7:
/home/mland/my/games104/Piccolo/engine/3rdparty/JoltPhysics/Build/../Jolt/Core/Core.h:232:15: error: unknown type name 'uint8_t'
using uint8 = uint8_t;
^
/home/mland/my/games104/Piccolo/engine/3rdparty/JoltPhysics/Build/../Jolt/Core/Core.h:233:16: error: unknown type name 'uint16_t'
using uint16 = uint16_t;
^
/home/mland/my/games104/Piccolo/engine/3rdparty/JoltPhysics/Build/../Jolt/Core/Core.h:234:16: error: unknown type name 'uint32_t'
using uint32 = uint32_t;
^
/home/mland/my/games104/Piccolo/engine/3rdparty/JoltPhysics/Build/../Jolt/Core/Core.h:235:16: error: unknown type name 'uint64_t'
using uint64 = uint64_t;
^
在之后对这几种类型的使用都会报错
OS: Archlinux
Kernel: x86_64 Linux 6.7.0-arch3-1
CPU: Intel Core i5-9300H
GPU: NVIDIA GeForce GTX 1650
clang version: 16.0.6
cmake version: 3.28.1
ninja version: 1.11.1
+1, 同archlinux
/home/YXH_XianYu/GAMES104/GAMES104/engine/3rdparty/JoltPhysics/Build/../Jolt/Core/Core.h:232:7: note: 'uint' declared here
using uint = unsigned int;
^
In file included from /home/YXH_XianYu/GAMES104/GAMES104/engine/3rdparty/JoltPhysics/Jolt/Core/IssueReporting.cpp:4:
In file included from /home/YXH_XianYu/GAMES104/GAMES104/engine/3rdparty/JoltPhysics/Build/../Jolt/Jolt.h:9:
/home/YXH_XianYu/GAMES104/GAMES104/engine/3rdparty/JoltPhysics/Build/../Jolt/Math/Math.h:161:31: error: unknown type name 'uint32'; did you mean 'uint'?
clang version: 16.0.6
cmake version: 3.28.3
解决了.
在 engine/3rdparty/JoltPhysics/Jolt/Core/Core.h的220行附近添加 #include <cstdint> 编译就过了.
最新版本的JolyPhysics有这行,但旧版本的JoltPhysics不知道为什么没有233.
解决了.
在 engine/3rdparty/JoltPhysics/Jolt/Core/Core.h的220行附近添加
#include <cstdint>编译就过了. 最新版本的JolyPhysics有这行,但旧版本的JoltPhysics不知道为什么没有233.
感谢,按照你的方法添加头文件后编译成功并运行