Hello Good Day:
Well last night i was till late trying to make this work, the GDNative C++ Example.
So this is the Guide:
GDNative C++ Example
And bout this part:
cd godot-cpp
scons platform=windows/linux/osx headers=../godot_headers generate_bindings=yes
cd ..
Get this error:
C:\GodotEngine\cpp_example\godot-cpp>scons platform=windows headers=../godot_headers generate_bindings=yes
scons: Reading SConscript files ...
scons: done reading SConscript files.
scons: Building targets ...
g++ -o src\core\AABB.o -c /EHsc /D_DEBUG /MDd -I. -Igodot_headers -Iinclude -Iinclude\core src\core\AABB.cpp
g++: error: /EHsc: No such file or directory
g++: error: /D_DEBUG: No such file or directory
g++: error: /MDd: No such file or directory
scons: *** [src\core\AABB.o] Error 1
scons: building terminated because of errors.
Inside SConstruct i found this:
if host_platform == 'windows' and not env['use_mingw']:
# MSVC
env.Append(LINKFLAGS=['/WX'])
if env['target'] == 'debug':
env.Append(CCFLAGS=['/EHsc', '/D_DEBUG', '/MDd'])
elif env['target'] == 'release':
env.Append(CCFLAGS=['/O2', '/EHsc', '/DNDEBUG', '/MD'])
So i cant find the problem, and also where to start, i installed mingw and added path but seems SCONS cant find it.
Any help would be appreciated.
EDIT1: So, after reading the scrpit i made 2 modifucations in SConstruct:
opts.Add(BoolVariable('use_mingw', 'Use the MinGW compiler - only effective on Windows', True)) Original was False
env['CXX'] = 'g++' Original was: 'x86_64-w64-mingw32-g++'
And after trying the comand again i found folowing error:
C:\GodotEngine\cpp_example\godot-cpp>scons headers=../godot_headers generate_bindings=yes
scons: Reading SConscript files ...
scons: done reading SConscript files.
scons: Building targets ...
g++ -o src\core\AABB.o -c -g -O3 -std=c++14 -Wwrite-strings -I. -Igodot_headers -Iinclude -Iinclude\core src\core\AABB.cpp
In file included from include\core/Vector3.hpp:6:0,
from include\core/AABB.hpp:4,
from src\core\AABB.cpp:1:
include\core/String.hpp:4:29: fatal error: gdnative/string.h: No such file or directory
#include <gdnative/string.h>
^
compilation terminated.
scons: *** [src\core\AABB.o] Error 1
scons: building terminated because of errors.
Now , there is a problem with files from example??? Because the file string.h is in the path mentioned.