Compiling Native Bindings (godot-cpp) fails on Windows 10: cannot convert from 'const wchar_t' to 'wchar_t &'

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By Razzlegames

Is Windows 10 build of C++ bindings for Native script, broken? Or am I somehow missing something?

  • I tried with default godot_api.json (including in repo)
  • It also failed with one generated from Godot 3.2.3. I’ll upload those logs if needed as well

Failure log:


src\core\String.cpp(102): error C2440: 'return': cannot convert from 'const wchar_t' to 'wchar_t &'


  • godot-cpp branch: nativescript-1.1

  • Visual Studio 2019 power shell, with compiler:

PS C:\Users\razzl\Development\Godot\gdnative_cpp_example\godot-cpp> cl -version
Microsoft (R) C/C++ Optimizing Compiler Version 19.27.29112 for x86
Copyright (C) Microsoft Corporation.  All rights reserved.

cl : Command line warning D9002 : ignoring unknown option '-version'
cl : Command line error D8003 : missing source filename
PS C:\Users\razzl\Development\Godot\gdnative_cpp_example\godot-cpp>

Also side issue is: I have mingw 64 in PATH but using the scons flag (use_mingw=true) doesn’t actually use g++ as expected. I tried this as an alternative. ( I didn’t attempt to fix the build script or dive into any of that yet)

Log of failure to use mingw:

Please note, the use of g++ in end of log to show it’s in the path.


:bust_in_silhouette: Reply From: Razzlegames

godot-cpp bindings, 3.2 branch is actually stable and works. The README and docs just need to be updated as it implies that nativescript-1.1 is the baseline branch for 3.1 and above.

It could be a great idea to improve this process by using Docker build containers that contain all GDNative dependencies for all stable releases. E.g. one for 3.1, 3.2.x etc. It would avoid fiddling with what submodule branch to be on, what compilers don’t have issues (with conversion above), etc.

It would make the process repeatable and fool proof, in my opinion as everything you need to build would be within the container.