How to build an available libassimp.a on linux with armeabi-v7a

#1

hi, I’ve succeeded in building the static library libassimp.a on linux with the cmd :
cmake CMakeLists.txt -DANDROID_FORCE_ARM_BUILD=ON -DANDROID_ABI=“armeabi-v7a” -DANDROID_NATIVE_API_LEVEL=“android-19”
-DCMAKE_C_COMPILER=/tmp/ndk-root/bin/arm-linux-androideabi-gcc-4.9
-DANDROID_TOOLCHAIN_NAME="/home/wss/android_toolchain/android-ndk-r15c/toolchains/arm-linux-androideabi-4.9",

and the NDK is android-ndk-r15c-linux-x86_64, but the libassimp.a is not available when compile the android app named androidAssimpExample, but the original libassimp.a provided by the code package works,

there are many weird mistakes:

linking libOFAndroidApp.so failed.
/tmp/ndk-root/bin/…/lib/gcc/arm-linux-androideabi/4.9.x/…/…/…/…/include/c++/4.9.x/iostream:74: error: undefined reference to ‘std::ios_base::Init::Init()’
/tmp/ndk-root/bin/…/lib/gcc/arm-linux-androideabi/4.9.x/…/…/…/…/include/c++/4.9.x/iostream:0: error: undefined reference to ‘std::ios_base::Init::~Init()’
/tmp/ndk-root/bin/…/lib/gcc/arm-linux-androideabi/4.9.x/…/…/…/…/include/c++/4.9.x/bits/vector.tcc:69: error: undefined reference to 'std::__throw_length_error(char const
)’
/home/wss/android/assimp/code/AMFImporter.hpp:395: error: undefined reference to ‘std::basic_string<char, std::char_traits, std::allocator >::basic_string()’
/home/wss/android/assimp/code/OgreImporter.h:64: error: undefined reference to ‘std::basic_string<char, std::char_traits, std::allocator >::basic_string()’
/home/wss/android/assimp/code/OgreImporter.h:64: error: undefined reference to ‘std::basic_string<char, std::char_traits, std::allocator >::~basic_string()’
/tmp/ndk-root/bin/…/lib/gcc/arm-linux-androideabi/4.9.x/…/…/…/…/include/c++/4.9.x/bits/stl_vector.h:1585: error: undefined reference to 'std::__throw_length_error(char const
)’
/home/wss/android/assimp/code/AMFImporter_Geometry.cpp:75: error: undefined reference to ‘std::allocator::allocator()’
/home/wss/android/assimp/code/AMFImporter_Geometry.cpp:75: error: undefined reference to ‘std::basic_string<char, std::char_traits, std::allocator >::basic_string(char const*, std::allocator const&)’
/home/wss/android/assimp/code/AMFImporter_Geometry.cpp:75: error: undefined reference to ‘std::basic_string<char, std::char_traits, std::allocator >::~basic_string()’
/home/wss/android/assimp/code/AMFImporter_Geometry.cpp:75: error: undefined reference to ‘std::allocator::~allocator()’

it seems that the library stdc++ is not include, but it’s indeed included, we can find it in CMakeList.txt

could anyone tell me or give me some suggestions for how to compile the ibassimp.a(armeabi-v7a)on linux, thanks a lot

#2

Why do you compile library by yourself?
Do you need a latest assimp feature or some custom configuration?
Check out apothecary repo which is used for all lib compilation.
Also it might be helpful to check out assimp repo in case if they have any ongoing issue.

#5

Because I’don’t know to get the libs before, And I can build the right library now, thank you very much.

#6

The libraries come with the OF download, you don’t need to compile them. IF you are working from github take a look at the install from github file in the root of the repo