godotengine / godot-cpp

C++ bindings for the Godot script API
MIT License
1.73k stars 571 forks source link

Generating Android native bindings creates a static library file #336

Open Kwu564 opened 5 years ago

Kwu564 commented 5 years ago

Running the following: scons platform=android generate_bindings=yes android_arch=arm64v8 on windows gives me a .a static library file. Godot's gdnlib file requires that I create a dynamic library file (.so). Is this intentional and I'm doing something wrong or is it a bug?

sheepandshepherd commented 5 years ago

You're running scons in the godot-cpp folder, right? It's normal to get a static library from the bindings, which will later be statically linked when compiling your own project into the actual dynamic library.

Kwu564 commented 5 years ago

Ah I see, so that scons command is supposed to generate a static library. And yeah I ran scons inside godot-cpp. I was encountering linking errors using visual studio to compile my own project using the static library. After a lot of trial and error, I eventually figured out that I had to adjust a few linking and compile settings in visual studio as well as raise the minimum target API to match the API level used to generate the static library library file.