How to compile a module using the C++ STL for Android

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By Toguro
:warning: Old Version Published before Godot 3 was released.


I try to use my module for Android and first I need templates. I can’t get templates because I get this error message:

android-ndk-r13/sources/cxx-stl/gnu-libstdc++/4.9/include/bits/stl_algobase.h:59:28: fatal error: bits/c++config.h: No such file or directory
 #include <bits/c++config.h>
compilation terminated.
scons: *** [modules/mymodule/] Error 1
scons: building terminated because of errors.

I use:

$ scons platform=android target=release_debug

My system is ubuntu 64 bits

I can’t solve this problem alone, please I need help.

Thank you.

:bust_in_silhouette: Reply From: Akien

While hacking a bit at the buildsystem for an unrelated upcoming PR, I noticed that platform/android/ has an android_stl option that defaults to no.

Building with scons p=android android_stl=yes might be the solution to your problem.
You can check existing build options with scons p=android --help.

Thank you very much! It worked like a charm!

So happy to solve this issue that was killing me.

I’m glad to meet you!

Toguro | 2016-10-13 14:15

Amazing, this was stopping me compile for android also. Thank you very much.

rhythmpattern | 2017-06-25 08:16