godot-cpp icon indicating copy to clipboard operation
godot-cpp copied to clipboard

Scons randomly failing on Windows, getting confused about .o files (?)

Open myblindy opened this issue 1 month ago • 1 comments

Godot version

v4.5.1-stable

godot-cpp version

4.3

System information

Windows 11

Issue description

I cloned the template project and added a class and built it once and it worked fine, showed in Godot and everything. Then I added a few methods and scons stopped working with no compilation or link time errors:

Steps to reproduce

PS E:\gitrepos\GdVectorSvgControl> scons
scons: Reading SConscript files ...
Auto-detected 32 CPU cores available for build parallelism. Using 31 cores by default. You can override it with the -j argument.
Building for architecture x86_64 on platform windows
scons: done reading SConscript files.
scons: Building targets ...
Compiling godot-cpp\src\godot.cpp ...
Compiling godot-cpp\src\classes\editor_plugin_registration.cpp ...
Compiling godot-cpp\src\classes\low_level.cpp ...
Compiling godot-cpp\src\classes\wrapped.cpp ...
Compiling godot-cpp\src\core\class_db.cpp ...
Compiling godot-cpp\src\core\error_macros.cpp ...
Compiling godot-cpp\src\core\memory.cpp ...
Compiling godot-cpp\src\core\method_bind.cpp ...
Compiling godot-cpp\src\core\object.cpp ...
Compiling godot-cpp\src\core\print_string.cpp ...
scons: *** [godot-cpp\src\godot.windows.template_debug.x86_64.o] The system cannot find the file specified
scons: *** [godot-cpp\src\classes\editor_plugin_registration.windows.template_debug.x86_64.o] The system cannot find the file specified
scons: *** [godot-cpp\src\classes\low_level.windows.template_debug.x86_64.o] The system cannot find the file specified
scons: *** [godot-cpp\src\classes\wrapped.windows.template_debug.x86_64.o] The system cannot find the file specified
scons: *** [godot-cpp\src\core\class_db.windows.template_debug.x86_64.o] The system cannot find the file specified
scons: *** [godot-cpp\src\core\error_macros.windows.template_debug.x86_64.o] The system cannot find the file specified
scons: *** [godot-cpp\src\core\memory.windows.template_debug.x86_64.o] The system cannot find the file specified
scons: *** [godot-cpp\src\core\method_bind.windows.template_debug.x86_64.o] The system cannot find the file specified
scons: *** [godot-cpp\src\core\object.windows.template_debug.x86_64.o] The system cannot find the file specified
scons: *** [godot-cpp\src\core\print_string.windows.template_debug.x86_64.o] The system cannot find the file specified
scons: building terminated because of errors.
PS E:\gitrepos\GdVectorSvgControl> cl
Microsoft (R) C/C++ Optimizing Compiler Version 19.50.35719 for x64
Copyright (C) Microsoft Corporation.  All rights reserved.

usage: cl [ option... ] filename... [ /link linkoption... ]

Why is it getting confused about .o files? This is a Windows build with MSVC installed and working. Can I tell it somehow to compile correctly or something? And why did it randomly break after working once?

Minimal reproduction project

https://github.com/myblindy/GdVectorSvgControl

myblindy avatar Dec 06 '25 21:12 myblindy

My guess would be that you don't have g++ installed; I got similar errors when I mistakenly assumed that scons would use the mingw toolchain I had bundled with CLion, but had to install mingw manually and add its bin directory (including g++) to PATH so the build would run. However, that wouldn't explain why it worked for you on your first attempt - are you sure you didn't change anything about your environment between those two builds? Does it work again if you remove those "few methods" you added?

Alfrink avatar Dec 08 '25 21:12 Alfrink