[SOLVED] Problems compiling module in GDNative tutorial

cyborg-interactivecyborg-interactive Posts: 4Member
edited August 2018 in Programming

What compiler do I need to use GDNative on OSX High Sierra?
I'm following the tutorial:

docs.godotengine.org/en/3.0/tutorials/plugins/gdnative/gdnative-cpp-example.html

and getting errors on the "Compiling our plugin" step:

In file included from src/gdexample.cpp:1:
In file included from src/gdexample.h:4:
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 constructor
                Vector3 elements[3];
                        ^
godot-cpp/include/core/Vector3.hpp:31:2: note: because type 'godot::Vector3' has a user-provided default constructor
        Vector3();
        ^
In file included from src/gdexample.cpp:1:
In file included from src/gdexample.h:4:
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 constructor
                Vector3 x, y, z;
                        ^

Also warnings:

g++ -o src/gdexample.os -c -fPIC -I. -Isrc -Igodot_headers -Igodot-cpp/include -Igodot-cpp/include/core src/gdexample.cpp
In file included from src/gdexample.cpp:1:
In file included from src/gdexample.h:4:
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>
                                                                               ^

My g++ version is:

g++ --version
Configured with: --prefix=/Applications/Xcode.app/Contents/Developer/usr --with-gxx-include-dir=/usr/include/c++/4.2.1
Apple LLVM version 9.1.0 (clang-902.0.39.1)
Target: x86_64-apple-darwin17.5.0
Thread model: posix
InstalledDir: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin

Tags :

Best Answer

Answers

Leave a Comment

BoldItalicStrikethroughOrdered listUnordered list
Emoji
Image
Align leftAlign centerAlign rightToggle HTML viewToggle full pageToggle lights
Drop image/file