Current goal: follow along with maven build script entities for my custom library with presets, building for android NDK, then include into gradle to test in an actual Android app.
I have my lib generating a javacpp bindings (mylib.java) based on presets
Created new preset via this
https://github.com/bytedeco/javacpp-presets/wiki/Create-New-PresetsRunning this (mylib is the name of the lib im adding as a preset):
mvn install \
-Djavacpp.platform=android-arm \
-Djavacpp.platform.root=/home/adowdy/Android/Sdk/ndk-bundle/ \
-Djavacpp.platform.compiler=/home/adowdy/Android/Sdk/ndk-bundle/toolchains/arm-linux-androideabi-4.9/prebuilt/linux-x86_64/bin/arm-linux-androideabi-g++ \
--projects .,mylib
I get missing headers which exist inside of my NDK (which ive provided to mvn javacpp above):
In file included from /home/adowdy/projects/javacpp-presets/mylib/target/classes/org/bytedeco/javacpp/jnimylib.cpp:72:0:
/home/adowdy/Android/Sdk/ndk-bundle/sources/cxx-stl/gnu-libstdc++/4.9/include/exception:37:28: fatal error: bits/c++config.h: No such file or directory
#include <bits/c++config.h>
^
compilation terminated.
In file included from /home/adowdy/projects/javacpp-presets/mylib/target/classes/jnijavacpp.cpp:72:0:
/home/adowdy/Android/Sdk/ndk-bundle/sources/cxx-stl/gnu-libstdc++/4.9/include/exception:37:28: fatal error: bits/c++config.h: No such file or directory
#include <bits/c++config.h>
^
compilation terminated.
I've attempted to solve this by doing this before running mvn install:
export CPATH=/home/adowdy/Android/Sdk/ndk-bundle/sources/cxx-stl/gnu-libstdc++/4.9/libs/armeabi-v7a/include
export LIBRARY_PATH=/home/adowdy/Android/Sdk/ndk-bundle/sources/cxx-stl/gnu-libstdc++/4.9/libs/armeabi-v7a
export LD_LIBRARY_PATH=/home/adowdy/Android/Sdk/ndk-bundle/sources/cxx-stl/gnu-libstdc++/4.9/libs/armeabi-v7a
these are the paths in latest NDK (to my knowledge) to the libraries that these files require.
But even exporting the environment, it solves the include files, but still won't link to libgnustl_shared.so in the ndk!
Anyone know what's up? How do I give these paths to the cross-compiler? Is there a maven config similar to javacpp.platform.blah, but for lib directories? I know next to nothing of maven, but I'll keep digging.
Cheers, - AD