[odb-users] ODB on Android

Wolfgang Haupt haupt.wolfgang at gmail.com
Mon Apr 13 11:27:26 EDT 2020


Hi,

I'm trying to get odb working for android.
So far I read: http://wiki.codesynthesis.com/Using_ODB_on_Android

And I can cross-compile libodb and libodb-sqlite+libodb-mysql just fine.

However I struggle to see how this will work together with the odb compiler.
In the above guide there is no word about the odb compiler itself, so I 
tried
to use the binary distribution for linux.
When I do this I have to patch: 
/arm-linux-androideabi-21-debug/lib/odb/x86_64-linux-gnu/include/c++/4.9.3/x86_64-linux-gnu/bits/os_defines.h/

Because /__GLIBC_PREREQ/ is not defined.
Then I get more errors:

/In file included from 
/home/a1rwulf/Android/android-ndk-r18b/sysroot/usr/include/features.h:33:0,//
//                 from 
/home/a1rwulf/Android/omniyon-depends/arm-linux-androideabi-21-debug/lib/odb/x86_64-linux-gnu/include/c++/4.9.3/x86_64-linux-gnu/bits/os_defines.h:39,//
//                 from 
/home/a1rwulf/Android/omniyon-depends/arm-linux-androideabi-21-debug/lib/odb/x86_64-linux-gnu/include/c++/4.9.3/x86_64-linux-gnu/bits/c++config.h:430,//
//                 from 
/home/a1rwulf/Android/omniyon-depends/arm-linux-androideabi-21-debug/lib/odb/x86_64-linux-gnu/include/c++/4.9.3/string:38,//
//                 from <standard-odb-prologue>:7://
///home/a1rwulf/Android/android-ndk-r18b/sysroot/usr/include/string.h:205:9: 
error: attributes are not allowed on a function-definition//
//         __prefer_this_overload {/

I'm pretty sure it is because the compiled gcc included in the binary 
distribution package does of course target
Linux and not Android and there will be a mismatch in the libc or 
libstdc++ etc. (I lack knowledge in this area)

I then tried to compile odb for Android, but I don't really see how this 
works as Android has switched to clang
and the toolchain does not have a gcc with plugin support.

Any ideas on how to proceed with this?
Did anybody already get this working with recent Android NDK's (I'm 
using NDK 18b atm)?


Best Regards,
Wolfgang



More information about the odb-users mailing list