BastiaanOlij / gdtest

Nativescript 1.1 video introduction example
MIT License
8 stars 4 forks source link

Compile issue on OSX #3

Open mudlee opened 5 years ago

mudlee commented 5 years ago

I'm facing with this issue:

`shiva:cpp_test mudlee$ scons platform=osx use_llv=yes scons: Reading SConscript files ... scons: done reading SConscript files. scons: Building targets ... g++ -o src/library.os -c -g -O3 -arch x86_64 -fPIC -I. -Isrc -Igodot-cpp/godot_headers -Igodot-cpp/include -Igodot-cpp/include/core -Igodot-cpp/include/gen src/library.cpp In file included from src/library.cpp:1: In file included from godot-cpp/include/core/Godot.hpp:11: In file included from godot-cpp/include/core/CoreTypes.hpp:4: godot-cpp/include/core/Defs.hpp:7:6: warning: scoped enumerations are a C++11 extension [-Wc++11-extensions] enum class Error { ^ godot-cpp/include/core/Defs.hpp:68:50: warning: variadic templates are a C++11 extension [-Wc++11-extensions] template <typename T, typename ValueT, typename... Args> ^ godot-cpp/include/core/Defs.hpp:85:66: warning: variadic templates are a C++11 extension [-Wc++11-extensions] template <typename KV, typename KeyT, typename ValueT, typename... Args> ^ In file included from src/library.cpp:1: In file included from godot-cpp/include/core/Godot.hpp:11: In file included from godot-cpp/include/core/CoreTypes.hpp:7: godot-cpp/include/core/Array.hpp:43:17: warning: variadic templates are a C++11 extension [-Wc++11-extensions] template ^ In file included from src/library.cpp:1: In file included from godot-cpp/include/core/Godot.hpp:11: In file included from godot-cpp/include/core/CoreTypes.hpp:8: godot-cpp/include/core/Basis.hpp:15:11: error: union member 'elements' has a non-trivial default constructor Vector3 elements[3]; ^ godot-cpp/include/core/Vector3.hpp:32:2: note: because type 'godot::Vector3' has a user-provided default constructor Vector3(); ^ In file included from src/library.cpp:1: In file included from godot-cpp/include/core/Godot.hpp:11: In file included from godot-cpp/include/core/CoreTypes.hpp:8: godot-cpp/include/core/Basis.hpp:16:11: error: union member 'x' has a non-trivial default constructor Vector3 x, y, z; ^ godot-cpp/include/core/Vector3.hpp:32:2: note: because type 'godot::Vector3' has a user-provided default constructor Vector3(); ^ In file included from src/library.cpp:1: In file included from godot-cpp/include/core/Godot.hpp:11: In file included from godot-cpp/include/core/CoreTypes.hpp:8: godot-cpp/include/core/Basis.hpp:16:14: error: union member 'y' has a non-trivial default constructor Vector3 x, y, z; ^ godot-cpp/include/core/Vector3.hpp:32:2: note: because type 'godot::Vector3' has a user-provided default constructor Vector3(); ^ In file included from src/library.cpp:1: In file included from godot-cpp/include/core/Godot.hpp:11: In file included from godot-cpp/include/core/CoreTypes.hpp:8: godot-cpp/include/core/Basis.hpp:16:17: error: union member 'z' has a non-trivial default constructor Vector3 x, y, z; ^ godot-cpp/include/core/Vector3.hpp:32:2: note: because type 'godot::Vector3' has a user-provided default constructor Vector3(); ^ In file included from src/library.cpp:1: In file included from godot-cpp/include/core/Godot.hpp:11: In file included from godot-cpp/include/core/CoreTypes.hpp:10: In file included from godot-cpp/include/core/Dictionary.hpp:4: In file included from godot-cpp/include/core/Variant.hpp:13: In file included from godot-cpp/include/core/PoolArrays.hpp:10: godot-cpp/include/core/GodotGlobal.hpp:28:17: warning: variadic templates are a C++11 extension [-Wc++11-extensions] template ^ In file included from src/library.cpp:1: In file included from godot-cpp/include/core/Godot.hpp:11: In file included from godot-cpp/include/core/CoreTypes.hpp:10: In file included from godot-cpp/include/core/Dictionary.hpp:4: godot-cpp/include/core/Variant.hpp:129:43: error: delegating constructors are permitted only in C++11 inline Variant(unsigned short p_short) : Variant((unsigned int) p_short) {} ^~~ godot-cpp/include/core/Variant.hpp:131:39: error: delegating constructors are permitted only in C++11 inline Variant(signed char p_char) : Variant((signed int) p_char) {} ^~~ godot-cpp/include/core/Variant.hpp:133:41: error: delegating constructors are permitted only in C++11 inline Variant(unsigned char p_char) : Variant((unsigned int) p_char) {} ^~~ In file included from src/library.cpp:1: In file included from godot-cpp/include/core/Godot.hpp:11: In file included from godot-cpp/include/core/CoreTypes.hpp:10: godot-cpp/include/core/Dictionary.hpp:19:17: warning: variadic templates are a C++11 extension [-Wc++11-extensions] template ^ In file included from src/library.cpp:1: In file included from godot-cpp/include/core/Godot.hpp:13: In file included from godot-cpp/include/core/Ref.hpp:6: In file included from godot-cpp/include/gen/Reference.hpp:11: godot-cpp/include/gen/Object.hpp:87:17: warning: variadic templates are a C++11 extension [-Wc++11-extensions] template Variant emit_signal(const String signal, Args... args){ ^ godot-cpp/include/gen/Object.hpp:90:17: warning: variadic templates are a C++11 extension [-Wc++11-extensions] template Variant call(const String method, Args... args){ ^ godot-cpp/include/gen/Object.hpp:93:17: warning: variadic templates are a C++11 extension [-Wc++11-extensions] template Variant calldeferred(const String method, Args... args){ ^ In file included from src/library.cpp:1: In file included from godot-cpp/include/core/Godot.hpp:13: godot-cpp/include/core/Ref.hpp:15:15: warning: in-class initialization of non-static data member is a C++11 extension [-Wc++11-extensions] T reference = nullptr; ^ In file included from src/library.cpp:1: In file included from godot-cpp/include/core/Godot.hpp:20: godot-cpp/include/gen/NativeScript.hpp:40:17: warning: variadic templates are a C++11 extension [-Wc++11-extensions] template Object new(Args... args){ ^ In file included from src/library.cpp:1: godot-cpp/include/core/Godot.hpp:151:34: warning: variadic templates are a C++11 extension [-Wc++11-extensions] template<class T, class R, class ...args> ^ godot-cpp/include/core/Godot.hpp:157:34: warning: variadic templates are a C++11 extension [-Wc++11-extensions] template<class T, class R, class ...args> ^ godot-cpp/include/core/Godot.hpp:175:13: warning: variadic templates are a C++11 extension [-Wc++11-extensions] template ^ godot-cpp/include/core/Godot.hpp:178:20: warning: variadic templates are a C++11 extension [-Wc++11-extensions] template<int N, int... I> ^ godot-cpp/include/core/Godot.hpp:180:15: warning: alias declarations are a C++11 extension [-Wc++11-extensions] using type = typename __construct_sequence<N-1, N-1, I...>::type; ^ godot-cpp/include/core/Godot.hpp:183:13: warning: variadic templates are a C++11 extension [-Wc++11-extensions] template ^ godot-cpp/include/core/Godot.hpp:185:15: warning: alias declarations are a C++11 extension [-Wc++11-extensions] using type = Sequence<I...>; ^ godot-cpp/include/core/Godot.hpp:190:33: warning: variadic templates are a C++11 extension [-Wc++11-extensions] template<class T, class R, class... As> ^ godot-cpp/include/core/Godot.hpp:194:14: warning: variadic templates are a C++11 extension [-Wc++11-extensions] template ^ godot-cpp/include/core/Godot.hpp:200:24: warning: variadic templates are a C++11 extension [-Wc++11-extensions] template<class T, class... As> ^ godot-cpp/include/core/Godot.hpp:204:14: warning: variadic templates are a C++11 extension [-Wc++11-extensions] template ^ godot-cpp/include/core/Godot.hpp:211:33: warning: variadic templates are a C++11 extension [-Wc++11-extensions] template<class T, class R, class... As> ^ godot-cpp/include/core/Godot.hpp:223:82: error: expected '(' for function-style cast or type construction method->apply(var, obj, arg, typename construct_sequence<sizeof...(As)>::type {});


godot-cpp/include/core/Godot.hpp:228:33: warning: variadic templates are a C++11 extension [-Wc++11-extensions]
template<class T, class R, class... As>
                                ^
godot-cpp/include/core/Godot.hpp:231:21: warning: alias declarations are a C++11 extension [-Wc++11-extensions]
        using MethodType = _WrappedMethod<T, R, As...>;
                           ^
godot-cpp/include/core/Godot.hpp:237:33: warning: variadic templates are a C++11 extension [-Wc++11-extensions]
template<class T, class R, class... As>
                                ^
godot-cpp/include/core/Godot.hpp:247:34: warning: variadic templates are a C++11 extension [-Wc++11-extensions]
template<class T, class R, class ...A>
                                 ^
godot-cpp/include/core/Godot.hpp:254:34: warning: variadic templates are a C++11 extension [-Wc++11-extensions]
template<class T, class R, class ...A>
                                 ^
godot-cpp/include/core/Godot.hpp:484:24: warning: variadic templates are a C++11 extension [-Wc++11-extensions]
template<class T, class... Args>
                       ^
In file included from src/library.cpp:2:
In file included from src/gdtest.hpp:5:
godot-cpp/include/gen/Node.hpp:158:17: warning: variadic templates are a C++11 extension [-Wc++11-extensions]
        template <class... Args> Variant rpc(const String method, Args... args){
                       ^
godot-cpp/include/gen/Node.hpp:161:17: warning: variadic templates are a C++11 extension [-Wc++11-extensions]
        template <class... Args> Variant rpc_unreliable(const String method, Args... args){
                       ^
godot-cpp/include/gen/Node.hpp:164:17: warning: variadic templates are a C++11 extension [-Wc++11-extensions]
        template <class... Args> Variant rpc_id(const int64_t peer_id, const String method, Args... args){
                       ^
godot-cpp/include/gen/Node.hpp:167:17: warning: variadic templates are a C++11 extension [-Wc++11-extensions]
        template <class... Args> Variant rpc_unreliable_id(const int64_t peer_id, const String method, Args... args){
                       ^
33 warnings and 8 errors generated.
scons: *** [src/library.os] Error 1
scons: building terminated because of errors.`

Any idea?
mudlee commented 5 years ago

Updating line 26 to this solves the problem: env["CXX"] = "clang++ -std=c++11 -stdlib=libc++"

BastiaanOlij commented 5 years ago

Thanks, it needs to be in the settings a little lower or it will break the other platforms. I'll find some time this weekend to clean this up and make sure this project has the latest changes applied. I haven't touched it since I made the video.

mudlee commented 5 years ago

I've sent a PR

mudlee commented 5 years ago

just fyi: https://github.com/mudlee/godot-cpp