Build fails
Build fails on current revision with ambiguous overload.
/home/asdf/src/SpaghettiKart/src/port/GameExtractor.cpp:59:81: error: call of overloaded ‘Companion(const std::vector<unsigned char>&, ArchiveType, bool)’ is ambiguous
59 | Companion::Instance = new Companion(this->mGameData, ArchiveType::O2R, false);
| ^
/home/asdf/src/SpaghettiKart/torch/src/Companion.h:138:14: note: candidate: ‘Companion::Companion(std::vector<unsigned char>, ArchiveType, bool, const std::string&, const std::string&)’
138 | explicit Companion(std::vector<uint8_t> rom, const ArchiveType otr, const bool debug, const std::string& srcDir = "", const std::string& destPath = "") :
| ^~~~~~~~~
/home/asdf/src/SpaghettiKart/torch/src/Companion.h:125:14: note: candidate: ‘Companion::Companion(std::vector<unsigned char>, ArchiveType, bool, bool, const std::string&, const std::string&)’
125 | explicit Companion(std::vector<uint8_t> rom, const ArchiveType otr, const bool debug, const bool modding = false,
| ^~~~~~~~~
I'm having the problem with gcc-13.3.1, gcc-14.3.0 and clang-20.1.7
yes it's a problem with torch that I fix recently if you update it normally it should fix it
cant build too debian 12.11 gcc 12.2.0 clang 14.0.6
[74/448] Building CXX object CMakeFiles/Spaghettify.dir/src/engine/objects/Thwomp.cpp.o FAILED: CMakeFiles/Spaghettify.dir/src/engine/objects/Thwomp.cpp.o
[74/448] Building CXX object CMakeFiles/Spaghettify.dir/src/engine/objects/Thwomp.cpp.o
FAILED: CMakeFiles/Spaghettify.dir/src/engine/objects/Thwomp.cpp.o
/usr/bin/c++ -DAVOID_UB=1 -DCIMGUI_DEFINE_ENUMS_AND_STRUCTS -DCVAR_AUDIO_CHANNELS_SETTING="gAudioChannelsSetting" -DCVAR_CONSOLE_WINDOW_OPEN="gConsoleEnabled" -DCVAR_CONTROLLER_CONFIGURATION_WINDOW_OPEN="gControllerConfigurationEnabled" -DCVAR_CONTROLLER_DISCONNECTED_WINDOW_OPEN="gControllerDisconnectedWindowEnabled" -DCVAR_CONTROLLER_REORDERING_WINDOW_OPEN="gControllerReorderingWindowEnabled" -DCVAR_ENABLE_MULTI_VIEWPORTS="gEnableMultiViewports" -DCVAR_GAME_OVERLAY_FONT="gOverlayFont" -DCVAR_GFX_DEBUGGER_WINDOW_OPEN="gGfxDebuggerEnabled" -DCVAR_IMGUI_CONTROLLER_NAV="gControlNav" -DCVAR_INTERNAL_RESOLUTION="gInternalResolution" -DCVAR_LOW_RES_MODE="gLowResMode" -DCVAR_MENU_BAR_OPEN="gOpenMenuBar" -DCVAR_MSAA_VALUE="gMSAAValue" -DCVAR_PREFIX_ADVANCED_RESOLUTION="gAdvancedResolution" -DCVAR_PREFIX_CONTROLLERS="gControllers" -DCVAR_SDL_WINDOWED_FULLSCREEN="gSdlWindowedFullscreen" -DCVAR_SIMULATED_INPUT_LAG="gSimulatedInputLag" -DCVAR_STATS_WINDOW_OPEN="gStatsEnabled" -DCVAR_TEXTURE_FILTER="gTextureFilter" -DCVAR_VSYNC_ENABLED="gVsyncEnabled" -DCVAR_Z_FIGHTING_MODE="gZFightingMode" -DENABLE_RUMBLE=1 -DEXCLUDE_MPQ_SUPPORT -DF3DEX_GBI=1 -DFMT_SHARED -DNON_EQUIVALENT=1 -DNON_MATCHING=1 -DSPAGHETTI_VERSION="Latest2-179-g334fdeafd" -DSPDLOG_ACTIVE_LEVEL=0 -DSPDLOG_COMPILED_LIB -DSPDLOG_FMT_EXTERNAL -DSPDLOG_SHARED_LIB -DTINYXML2_IMPORT -DUNICODE -DUSE_NETWORKING -DVERSION_US=1 -DYAML_CPP_STATIC_DEFINE -D_CONSOLE -D_CRT_SECURE_NO_WARNINGS -D_LANGUAGE_C -D_UNICODE -D_USE_MATH_DEFINES -I/home/rt/spaggettikart/sk2/SpaghettiKart -I/home/rt/spaggettikart/sk2/SpaghettiKart/include -I/home/rt/spaggettikart/sk2/SpaghettiKart/include/assets -I/home/rt/spaggettikart/sk2/SpaghettiKart/src -I/home/rt/spaggettikart/sk2/SpaghettiKart/src/racing -I/home/rt/spaggettikart/sk2/SpaghettiKart/src/ending -I/home/rt/spaggettikart/sk2/SpaghettiKart/src/data -I/home/rt/spaggettikart/sk2/SpaghettiKart/src/buffers -I/home/rt/spaggettikart/sk2/SpaghettiKart/src/audio -I/home/rt/spaggettikart/sk2/SpaghettiKart/src/debug -I/home/rt/spaggettikart/sk2/SpaghettiKart/src/networking -I/home/rt/spaggettikart/sk2/SpaghettiKart/src/engine -I/home/rt/spaggettikart/sk2/SpaghettiKart/src/engine/courses -I/home/rt/spaggettikart/sk2/SpaghettiKart/src/engine/objects -I/home/rt/spaggettikart/sk2/SpaghettiKart/src/engine/particles -I/home/rt/spaggettikart/sk2/SpaghettiKart/src/enhancements -I/home/rt/spaggettikart/sk2/SpaghettiKart/src/enhancements/freecam -I/home/rt/spaggettikart/sk2/SpaghettiKart/build-cmake/_deps/sse2neon -I/home/rt/spaggettikart/sk2/SpaghettiKart/build-cmake -I/home/rt/spaggettikart/sk2/SpaghettiKart/libultraship/include -I/home/rt/spaggettikart/sk2/SpaghettiKart/libultraship/include/libultraship -I/home/rt/spaggettikart/sk2/SpaghettiKart/libultraship/src -I/home/rt/spaggettikart/sk2/SpaghettiKart/libultraship/src/log -I/home/rt/spaggettikart/sk2/SpaghettiKart/libultraship/src/debug -I/home/rt/spaggettikart/sk2/SpaghettiKart/libultraship/src/menu -I/home/rt/spaggettikart/sk2/SpaghettiKart/libultraship/src/utils -I/home/rt/spaggettikart/sk2/SpaghettiKart/libultraship/src/utils/binarytools -I/home/rt/spaggettikart/sk2/SpaghettiKart/libultraship/src/config -I/home/rt/spaggettikart/sk2/SpaghettiKart/libultraship/src/resource -I/home/rt/spaggettikart/sk2/SpaghettiKart/libultraship/src/resource/type -I/home/rt/spaggettikart/sk2/SpaghettiKart/libultraship/src/resource/factory -I/home/rt/spaggettikart/sk2/SpaghettiKart/libultraship/src/audio -I/home/rt/spaggettikart/sk2/SpaghettiKart/libultraship/src/window -I/home/rt/spaggettikart/sk2/SpaghettiKart/libultraship/src/window/gui -I/home/rt/spaggettikart/sk2/SpaghettiKart/libultraship/src/public -I/home/rt/spaggettikart/sk2/SpaghettiKart/libultraship/src/public/libultra -I/home/rt/spaggettikart/sk2/SpaghettiKart/libultraship/src/public/bridge -I/home/rt/spaggettikart/sk2/SpaghettiKart/libultraship/extern -I/home/rt/spaggettikart/sk2/SpaghettiKart/libultraship/extern/tinyxml2 -I/home/rt/spaggettikart/sk2/SpaghettiKart/libultraship/libultraship/Lib -I/home/rt/spaggettikart/sk2/SpaghettiKart/libultraship/libultraship/Lib/libjpeg/include -I/home/rt/spaggettikart/sk2/SpaghettiKart/libultraship/libultraship/Lib/spdlog/include -I/home/rt/spaggettikart/sk2/SpaghettiKart/libultraship/src/graphic/Fast3D/U64/PR -I/home/rt/spaggettikart/sk2/SpaghettiKart/libultraship/src/graphic -I/home/rt/spaggettikart/sk2/SpaghettiKart/build-cmake/_deps/dr_libs-src -I/home/rt/spaggettikart/sk2/SpaghettiKart/libultraship/src/../include -I/home/rt/spaggettikart/sk2/SpaghettiKart/build-cmake/_deps/imgui-src -I/home/rt/spaggettikart/sk2/SpaghettiKart/build-cmake/_deps/imgui-src/backends -I/home/rt/spaggettikart/sk2/SpaghettiKart/build-cmake/_deps/stb -I/home/rt/spaggettikart/sk2/SpaghettiKart/build-cmake/_deps/threadpool-src/include -I/home/rt/spaggettikart/sk2/SpaghettiKart/build-cmake/_deps/prism-src -I/home/rt/spaggettikart/sk2/SpaghettiKart/build-cmake/_deps/prism-src/lib -I/home/rt/spaggettikart/sk2/SpaghettiKart/build-cmake/_deps/prism-src/src -I/home/rt/spaggettikart/sk2/SpaghettiKart/torch -I/home/rt/spaggettikart/sk2/SpaghettiKart/torch/lib -I/home/rt/spaggettikart/sk2/SpaghettiKart/torch/src -I/home/rt/spaggettikart/sk2/SpaghettiKart/build-cmake/_deps/yaml-cpp-src/include -isystem /usr/include/SDL2 -pthread -msse2 -mfpmath=sse -std=gnu++20 -MD -MT CMakeFiles/Spaghettify.dir/src/engine/objects/Thwomp.cpp.o -MF CMakeFiles/Spaghettify.dir/src/engine/objects/Thwomp.cpp.o.d -o CMakeFiles/Spaghettify.dir/src/engine/objects/Thwomp.cpp.o -c /home/rt/spaggettikart/sk2/SpaghettiKart/src/engine/objects/Thwomp.cpp
In file included from /home/rt/spaggettikart/sk2/SpaghettiKart/libultraship/src/graphic/Fast3D/interpreter.h:13,
from /home/rt/spaggettikart/sk2/SpaghettiKart/libultraship/src/graphic/Fast3D/Fast3dWindow.h:10,
from /home/rt/spaggettikart/sk2/SpaghettiKart/src/engine/editor/EditorMath.h:9,
from /home/rt/spaggettikart/sk2/SpaghettiKart/src/engine/editor/GameObject.h:7,
from /home/rt/spaggettikart/sk2/SpaghettiKart/src/engine/editor/Editor.h:6,
from /home/rt/spaggettikart/sk2/SpaghettiKart/src/engine/World.h:24,
from /home/rt/spaggettikart/sk2/SpaghettiKart/src/engine/objects/Thwomp.h:6,
from /home/rt/spaggettikart/sk2/SpaghettiKart/src/engine/objects/Thwomp.cpp:3:
/home/rt/spaggettikart/sk2/SpaghettiKart/libultraship/src/graphic/Fast3D/lus_gbi.h:133: warning: "GIMMCMD" redefined
133 | #define GIMMCMD(x) = OPCODE(G_IMMFIRST - (x))
|
In file included from /home/rt/spaggettikart/sk2/SpaghettiKart/libultraship/include/libultraship/libultra.h:8,
from /home/rt/spaggettikart/sk2/SpaghettiKart/libultraship/include/libultraship/libultraship.h:3,
from /home/rt/spaggettikart/sk2/SpaghettiKart/src/engine/objects/Thwomp.cpp:1:
/home/rt/spaggettikart/sk2/SpaghettiKart/libultraship/include/libultraship/libultra/gbi.h:255: note: this is the location of the previous definition
255 | #define GIMMCMD(x) (G_IMMFIRST - (x))
|
/home/rt/spaggettikart/sk2/SpaghettiKart/libultraship/src/graphic/Fast3D/lus_gbi.h:802: warning: "_LANGUAGE_C" redefined
802 | #define _LANGUAGE_C
|
look like to be because of the old version of gcc
the CI use gcc 13 and I personally use gcc 15 so don't use version older then 13 I think it's your problem here
To be fair the compiler is correct here:
s16 D_800E597C[] = { 0x0000, 0x0000, 0x4000, 0x8000, 0x8000, 0xc000 };
The highest number s16 can store is 32767 but here we have 0x8000 which is 32768 (overflow) and 0xC000 which is 49152 (overflow). Guess this is undefined behavior and doing different things depending on architecture and compiler version?
Should it be u16 (unsigned could hold up to 65535) ?
Looked into this a bit more. The array gets used here only:
anAngle = D_800E597C[arg2] + gObjectList[objectIndex2].direction_angle[1];
Where both, onAngle and gObjectList[objectIndex2].direction_angle[1] are unsigned 16 bit integers. So it would make sense that the array should be unsigned, too, esp. as gcc should do a signed to unsigned conversion anyway according to https://stackoverflow.com/questions/19446888/adding-signed-and-unsigned-int
changed to my arch rig. updated to gcc
gcc-Version 15.1.1 20250729 (GCC)
doesnt build either.
with latest commit what error do you have ?
Now I get this:
/home/asdf/src/SpaghettiKart/src/engine/World.h:117:12: error: declaration of ‘World::Matrix World::Mtx’ changes meaning of ‘Mtx’ [-Wchanges-meaning]
117 | Matrix Mtx;
| ^~~
/home/asdf/src/SpaghettiKart/src/engine/World.h:51:16: note: used here to mean ‘typedef union MtxS Mtx’
51 | std::deque<Mtx> Objects;
| ^~~
In file included from /home/asdf/src/SpaghettiKart/libultraship/include/libultraship/libultra/thread.h:3,
from /home/asdf/src/SpaghettiKart/libultraship/include/libultraship/libultra/message.h:4,
from /home/asdf/src/SpaghettiKart/libultraship/include/libultraship/libultra/os.h:8,
from /home/asdf/src/SpaghettiKart/libultraship/include/libultraship/libultra/controller.h:162,
from /home/asdf/src/SpaghettiKart/libultraship/include/libultraship/libultra.h:4:
/home/asdf/src/SpaghettiKart/libultraship/include/libultraship/libultra/types.h:53:14: note: declared here
53 | typedef MtxS Mtx;
| ^~~
does this patch
diff --git a/src/engine/Matrix.cpp b/src/engine/Matrix.cpp
index 954b0fd90..dc645eeac 100644
--- a/src/engine/Matrix.cpp
+++ b/src/engine/Matrix.cpp
@@ -59,14 +59,14 @@ void SetTextMatrix(Mat4 mf, f32 x, f32 y, f32 arg3, f32 arg4) {
// AddMatrix but with custom gfx ptr arg and flags are predefined
Gfx* AddTextMatrix(Gfx* displayListHead, Mat4 mtx) {
// Push a new matrix to the stack
- gWorldInstance.Mtx.Objects.emplace_back();
+ gWorldInstance.Mat.Objects.emplace_back();
// Convert to a fixed-point matrix
- FrameInterpolation_RecordMatrixMtxFToMtx((MtxF*)mtx, &gWorldInstance.Mtx.Objects.back());
- guMtxF2L(mtx, &gWorldInstance.Mtx.Objects.back());
+ FrameInterpolation_RecordMatrixMtxFToMtx((MtxF*)mtx, &gWorldInstance.Mat.Objects.back());
+ guMtxF2L(mtx, &gWorldInstance.Mat.Objects.back());
// Load the matrix
- gSPMatrix(displayListHead++, &gWorldInstance.Mtx.Objects.back(), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
+ gSPMatrix(displayListHead++, &gWorldInstance.Mat.Objects.back(), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
return displayListHead;
}
@@ -146,43 +146,43 @@ void AddLocalRotation(Mat4 mat, IRotator rot) {
extern "C" {
void AddHudMatrix(Mat4 mtx, s32 flags) {
- AddMatrix(gWorldInstance.Mtx.Objects, mtx, flags);
+ AddMatrix(gWorldInstance.Mat.Objects, mtx, flags);
}
Mtx* GetScreenMatrix(void) {
- return &gWorldInstance.Mtx.Screen2D;
+ return &gWorldInstance.Mat.Screen2D;
}
Mtx* GetOrthoMatrix(void) {
- return &gWorldInstance.Mtx.Ortho;
+ return &gWorldInstance.Mat.Ortho;
}
Mtx* GetPerspMatrix(size_t cameraId) {
- return &gWorldInstance.Mtx.Persp[cameraId];
+ return &gWorldInstance.Mat.Persp[cameraId];
}
Mtx* GetLookAtMatrix(size_t cameraId) {
- return &gWorldInstance.Mtx.LookAt[cameraId];
+ return &gWorldInstance.Mat.LookAt[cameraId];
}
void AddObjectMatrix(Mat4 mtx, s32 flags) {
- AddMatrix(gWorldInstance.Mtx.Objects, mtx, flags);
+ AddMatrix(gWorldInstance.Mat.Objects, mtx, flags);
}
Mtx* GetShadowMatrix(size_t playerId) {
- return &gWorldInstance.Mtx.Shadows[playerId];
+ return &gWorldInstance.Mat.Shadows[playerId];
}
Mtx* GetKartMatrix(size_t playerId) {
- return &gWorldInstance.Mtx.Karts[playerId];
+ return &gWorldInstance.Mat.Karts[playerId];
}
void AddEffectMatrix(Mat4 mtx, s32 flags) {
- AddMatrix(gWorldInstance.Mtx.Objects, mtx, flags);
+ AddMatrix(gWorldInstance.Mat.Objects, mtx, flags);
}
void AddEffectMatrixOrtho(void) {
- auto& stack = gWorldInstance.Mtx.Objects;
+ auto& stack = gWorldInstance.Mat.Objects;
stack.emplace_back();
guOrtho(&stack.back(), 0.0f, SCREEN_WIDTH - 1, SCREEN_HEIGHT - 1, 0.0f, -100.0f, 100.0f, 1.0f);
@@ -191,7 +191,7 @@ extern "C" {
}
Mtx* GetEffectMatrix(void) {
- return GetMatrix(gWorldInstance.Mtx.Objects);
+ return GetMatrix(gWorldInstance.Mat.Objects);
}
@@ -200,14 +200,14 @@ extern "C" {
* We might need to adjust which ones we clear.
*/
void ClearMatrixPools(void) {
- gWorldInstance.Mtx.Objects.clear();
+ gWorldInstance.Mat.Objects.clear();
// gWorldInstance.Mtx.Shadows.clear();
//gWorldInstance.Mtx.Karts.clear();
// gWorldInstance.Mtx.Effects.clear();
}
void ClearObjectsMatrixPool(void) {
- gWorldInstance.Mtx.Objects.clear();
+ gWorldInstance.Mat.Objects.clear();
}
}
diff --git a/src/engine/World.h b/src/engine/World.h
index bd55a5166..dcc9a5f0f 100644
--- a/src/engine/World.h
+++ b/src/engine/World.h
@@ -114,7 +114,7 @@ public:
void NextCourse(void);
void PreviousCourse(void);
- Matrix Mtx;
+ Matrix Mat;
std::shared_ptr<Course> CurrentCourse;
fix the error ?
@coco875
building as following:
git clone https://github.com/HarbourMasters/SpaghettiKart.git --recursive
or
git stash git pull
no difference
then
git submodule update --init
Generate Ninja project
Add -DCMAKE_BUILD_TYPE:STRING=Release if you're packaging
cmake -H. -Bbuild-cmake -GNinja
Generate mk64.o2r and spaghetti.o2r
cmake --build build-cmake --target ExtractAssets
or if you want to generate the spaghetti.o2r file only
#cmake --build build-cmake --target GenerateO2R
Compile the project
Add --config Release if you're packaging
cmake --build build-cmake
Maybe i am missing something
does Fehler mean error ?
The patch works. Now fails with another error:
/home/asdf/src/SpaghettiKart/src/engine/objects/Thwomp.cpp:46:46: error: narrowing conversion of ‘32768’ from ‘int’ to ‘s16’ {aka ‘short int’} [-Wnarrowing]
46 | s16 D_800E597C[] = { 0x0000, 0x0000, 0x4000, 0x8000, 0x8000, 0xc000 };
| ^~~~~~
/home/asdf/src/SpaghettiKart/src/engine/objects/Thwomp.cpp:46:54: error: narrowing conversion of ‘32768’ from ‘int’ to ‘s16’ {aka ‘short int’} [-Wnarrowing]
46 | s16 D_800E597C[] = { 0x0000, 0x0000, 0x4000, 0x8000, 0x8000, 0xc000 };
| ^~~~~~
/home/asdf/src/SpaghettiKart/src/engine/objects/Thwomp.cpp:46:62: error: narrowing conversion of ‘49152’ from ‘int’ to ‘s16’ {aka ‘short int’} [-Wnarrowing]
46 | s16 D_800E597C[] = { 0x0000, 0x0000, 0x4000, 0x8000, 0x8000, 0xc000 };
| ^~~~~~
does Fehler mean error ?
Yes.
really weird it doesn't make an error until now all of this
what version of gcc ? (forget)
The first revision I cloned built fine but I don't know which one that was anymore.
line mentionned don't have been changed for a while
last successfull build was on june 24th
hmm really weird I guess it's some compileur weirdness, normally most of this error are only warning so make a pr to fix warning/error or wait until we do it
Hey,
i got it working for me: (my script with help from Arch linux AUR)
######### git clone --recursive https://github.com/HarbourMasters/SpaghettiKart.git
cd SpaghettiKart
wget https://aur.archlinux.org/cgit/aur.git/plain/spaghettikart-cmake-flags.patch?h=spaghettikart-git mv spaghettikart-cmake-flags.patch?h=spaghettikart-git spagspaghettikart-cmake-flags.patch
Clone the submodules
git submodule update --init
apply the patch
git apply spaghettikart-cmake-flags.patch
Generate Ninja project
cmake -H. -Bbuild-cmake -GNinja
Generate mk64.o2r and spaghetti.o2r
cmake --build build-cmake --target ExtractAssets
Compile the project
cmake --build build-cmake
for debian12 since gcc12 isnt supported any more:
in folder:
sed -i 's|#include
Compile the Rest
cmake --build build-cmake
############
Works with the patch.