godotengine / godot-docs

Godot Engine official documentation
https://docs.godotengine.org
Other
3.93k stars 3.21k forks source link

v3.2 Plugins - GDNative c++ example possibly wrong SConstruct file #3325

Open kristiannotari opened 4 years ago

kristiannotari commented 4 years ago

When in the section of "Compiling the plugin" the "hardcoded SConstruct file" given in the docs don't work used with the given scons command. I've just setup the module as described in the docs. I have successfully created the new api.json based on my installed Godot version (3.2).

Platform: MacOS 10.15.3 Target platform = "osx"

Errors (partial, a long list of errors shows up): `godot-cpp/include/core/Basis.hpp:294:25: error: no member named 'elements' in 'godot::Basis' elements[0] = p_basis.elements[0];


godot-cpp/include/core/Basis.hpp:295:3: error: use of undeclared identifier
      'elements'
                elements[1] = p_basis.elements[1];
                ^
fatal error: too many errors emitted, stopping now [-ferror-limit=]
5 warnings and 20 errors generated.
scons: *** [src/firebase.os] Error 1
scons: building terminated because of errors.`

I tried using the SConstruct file from the [gdnative_cpp_example repo](https://github.com/BastiaanOlij/gdnative_cpp_example) given in the docs and it works correctly.
jumpy88 commented 4 years ago

Hi @kristiannotari, I've created a project file for qt creator which works fine for linux to build C++ GDNative example. The advantage with respect to SConstruct is that it enables qt creator syntax highlighting and code completion for Godot library. If you want to give a look you find the file attached. I couldn't check but it should work for osx as it is. You just have to set the GDROOT variable you find inside this file. Demo.pro.zip

kristiannotari commented 4 years ago

Thanks jumpy. I've already "get it working" by using the SConstruct file I cited in the issue description. I'm not currently needing it anymore for plugins because I'd figured out another way to solve one of my dependencies problem in my project.

Never used qt creator nor I've had experience with something similar. I even don't fully understand what's behind the "compiling the plugin" process because I've had few experiences with this kind of low level workflow. So, at the moment, I can't help testing it for you. I've created this issue because, even if I could have made some mistakes down the road, that provided file seems to not work, at least for me.