Godot Version
v4.2.2.stable.official [15073afe3]
Question
I’m working on my first GDExtension, the porting of a GDScript game component to C++.
I’m using a Mac with macOS 14.5, but I’d like to target Windows, Linux, Mac and Android (and later, perhaps, iOS).
The rewritten component is working properly in my Godot project, and I can build the extension for the Mac and for Android. (I have only tested the gdextension version of my game on the Mac, and the performance gain is enormous. I haven’t yet tested the gdextension on Android, but the build process for it reports no problems, and the .so
files are present after the build completes.)
I’m having trouble building for Windows and Linux, however.
These are the scons
commands I’ve been trying:
scons platform=windows bits=64
scons: Reading SConscript files ...
WARNING: Unknown SCons variables were passed and will be ignored:
bits=64
Auto-detected 8 CPU cores available for build parallelism. Using 7 cores by default. You can override it with the -j argument.
Building for architecture arm64 on platform windows
scons: done reading SConscript files.
scons: Building targets ...
Compiling godot-cpp/src/godot.cpp ...
sh: arm64-w64-mingw32-g++: command not found
Compiling godot-cpp/src/classes/wrapped.cpp ...
sh: arm64-w64-mingw32-g++: command not found
Compiling godot-cpp/src/classes/low_level.cpp ...
scons: *** [godot-cpp/src/godot.windows.template_debug.arm64.o] Error 127
sh: arm64-w64-mingw32-g++: command not found
scons: *** [godot-cpp/src/classes/wrapped.windows.template_debug.arm64.o] Error 127
scons: *** [godot-cpp/src/classes/low_level.windows.template_debug.arm64.o] Error 127
scons: building terminated because of errors.
(Interestingly, the warning regarding “bits=64” being an unknown SCons variable doesn’t seem to be accurate, as this is definitely not ignored, and omitting it would result in file names with 32 instead of 64 in them.)
scons platform=linux bits=64
scons: Reading SConscript files ...
WARNING: Unknown SCons variables were passed and will be ignored:
bits=64
Auto-detected 8 CPU cores available for build parallelism. Using 7 cores by default. You can override it with the -j argument.
Building for architecture arm64 on platform linux
scons: done reading SConscript files.
scons: Building targets ...
Compiling godot-cpp/src/godot.cpp ...
Compiling godot-cpp/src/classes/wrapped.cpp ...
Compiling godot-cpp/src/classes/low_level.cpp ...
Compiling godot-cpp/src/classes/editor_plugin_registration.cpp ...
Compiling godot-cpp/src/core/memory.cpp ...
Compiling godot-cpp/src/core/method_bind.cpp ...
clang: error: unknown argument: '-fno-gnu-unique'
clang: error: unknown argument: '-fno-gnu-unique'
Compiling godot-cpp/src/core/class_db.cpp ...
scons: *** [godot-cpp/src/godot.linux.template_debug.arm64.o] Error 1
scons: *** [godot-cpp/src/classes/wrapped.linux.template_debug.arm64.o] Error 1
clang: error: unknown argument: '-fno-gnu-unique'
clang: error: unknown argument: '-fno-gnu-unique'
scons: *** [godot-cpp/src/classes/low_level.linux.template_debug.arm64.o] Error 1
scons: *** [godot-cpp/src/classes/editor_plugin_registration.linux.template_debug.arm64.o] Error 1
clang: error: unknown argument: '-fno-gnu-unique'
scons: *** [godot-cpp/src/core/memory.linux.template_debug.arm64.o] Error 1
clang: error: unknown argument: '-fno-gnu-unique'
scons: *** [godot-cpp/src/core/method_bind.linux.template_debug.arm64.o] Error 1
clang: error: unknown argument: '-fno-gnu-unique'
scons: *** [godot-cpp/src/core/class_db.linux.template_debug.arm64.o] Error 1
scons: building terminated because of errors.
What could be wrong here and how should I fix the problem?
I’m hoping that it’s just an oversight on my end, as the entire concept of GDExtensions and C++ put together is quite a mouthful (brainful?) for me.