hi all:
I want build SNPE C++ native on ubuntu14.04 according to
Building and Running on ARM Androidhttps://developer.qualcomm.com/docs/snpe/cplus_plus_tutorial.html. And I have try two mothed,
ndk-build NDK_TOOLCHAIN_VERSION=clang APP_STL=c++_shared and ndk-build NDK_TOOLCHAIN_VERSION=4.9 APP_STL=gnustl_shared
But both of them are failed. Fllowing is the failed log and it worked on Building and Running on x86 Linux
kom@kom:~/work/snpe-1.15.0/examples/NativeCpp/SampleCode$ndk-build NDK_TOOLCHAIN_VERSION=4.9 APP_STL=gnustl_shared
ndk-build NDK_TOOLCHAIN_VERSION=clang APP_STL=c++_shared
[armeabi-v7a] Install : libSNPE.so => libs/armeabi-v7a/libSNPE.so
[armeabi-v7a] Install : libsymphony-cpu.so => libs/armeabi-v7a/libsymphony-cpu.so
[armeabi-v7a] Install : libsymphonypower.so => libs/armeabi-v7a/libsymphonypower.so
[armeabi-v7a] Executable : snpe-sample
/home/kom/android-ndk-r11/sources/cxx-stl/llvm-libc++/libcxx/include/ios:734: error: undefined reference to 'std::__ndk1::ios_base::getloc() const'
/home/kom/android-ndk-r11/sources/cxx-stl/llvm-libc++/libcxx/include/__locale:174: error: undefined reference to 'std::__ndk1::locale::use_facet(std::__ndk1::locale::id&) const'
/home/kom/android-ndk-r11/sources/cxx-stl/llvm-libc++/libcxx/include/ios:734: error: undefined reference to 'std::__ndk1::locale::~locale()'
/home/kom/android-ndk-r11/sources/cxx-stl/llvm-libc++/libcxx/include/ios:668: error: undefined reference to 'std::__ndk1::ios_base::init(void*)'
/home/kom/android-ndk-r11/sources/cxx-stl/llvm-libc++/libcxx/include/ios:524: error: undefined reference to 'std::__ndk1::ios_base::clear(unsigned int)'
/home/kom/android-ndk-r11/sources/cxx-stl/llvm-libc++/libcxx/include/ios:668: error: undefined reference to 'std::__ndk1::ios_base::init(void*)'
/home/kom/android-ndk-r11/sources/cxx-stl/llvm-libc++/libcxx/include/ios:524: error: undefined reference to 'std::__ndk1::ios_base::clear(unsigned int)'
/home/kom/android-ndk-r11/sources/cxx-stl/llvm-libc++/libcxx/include/ios:734: error: undefined reference to 'std::__ndk1::ios_base::getloc() const'
/home/kom/android-ndk-r11/sources/cxx-stl/llvm-libc++/libcxx/include/__locale:174: error: undefined reference to 'std::__ndk1::locale::use_facet(std::__ndk1::locale::id&) const'
/home/kom/android-ndk-r11/sources/cxx-stl/llvm-libc++/libcxx/include/ios:734: error: undefined reference to 'std::__ndk1::locale::~locale()'
/home/kom/android-ndk-r11/sources/cxx-stl/llvm-libc++/libcxx/include/ios:734: error: undefined reference to 'std::__ndk1::ios_base::getloc() const'
/home/kom/android-ndk-r11/sources/cxx-stl/llvm-libc++/libcxx/include/__locale:174: error: undefined reference to 'std::__ndk1::locale::use_facet(std::__ndk1::locale::id&) const'
/home/kom/android-ndk-r11/sources/cxx-stl/llvm-libc++/libcxx/include/ios:734: error: undefined reference to 'std::__ndk1::locale::~locale()'
/home/kom/android-ndk-r11/sources/cxx-stl/llvm-libc++/libcxx/include/ios:734: error: undefined reference to 'std::__ndk1::locale::~locale()'
/home/kom/android-ndk-r11/sources/cxx-stl/llvm-libc++/libcxx/include/ios:734: error: undefined reference to 'std::__ndk1::ios_base::getloc() const'
/home/kom/android-ndk-r11/sources/cxx-stl/llvm-libc++/libcxx/include/__locale:174: error: undefined reference to 'std::__ndk1::locale::use_facet(std::__ndk1::locale::id&) const'
/home/kom/android-ndk-r11/sources/cxx-stl/llvm-libc++/libcxx/include/iosfwd:131: error: undefined reference to 'std::__ndk1::ios_base::~ios_base()'
/home/kom/android-ndk-r11/sources/cxx-stl/llvm-libc++/libcxx/include/iosfwd:131: error: undefined reference to 'std::__ndk1::ios_base::~ios_base()'
/home/kom/android-ndk-r11/sources/cxx-stl/llvm-libc++/libcxx/include/iosfwd:131: error: undefined reference to 'std::__ndk1::ios_base::~ios_base()'
/home/kom/android-ndk-r11/sources/cxx-stl/llvm-libc++/libcxx/include/iosfwd:131: error: undefined reference to 'std::__ndk1::ios_base::~ios_base()'
/home/kom/android-ndk-r11/sources/cxx-stl/llvm-libc++/libcxx/include/ios:734: error: undefined reference to 'std::__ndk1::cout'
/home/kom/android-ndk-r11/sources/cxx-stl/llvm-libc++/libcxx/include/ios:734: error: undefined reference to 'std::__ndk1::ctype<char>::id'
/home/kom/android-ndk-r11/sources/cxx-stl/llvm-libc++/libcxx/include/ios:734: error: undefined reference to 'std::__ndk1::cerr'
/home/kom/android-ndk-r11/sources/cxx-stl/llvm-libc++/libcxx/include/fstream:952: error: undefined reference to 'std::__ndk1::codecvt<char, char, mbstate_t>::id'
/home/kom/android-ndk-r11/sources/cxx-stl/llvm-libc++/libcxx/include/ios:524: error: undefined reference to 'std::__ndk1::ios_base::clear(unsigned int)'
/home/kom/android-ndk-r11/sources/cxx-stl/llvm-libc++/libcxx/include/ostream:757: error: undefined reference to 'std::__ndk1::ios_base::__set_badbit_and_consider_rethrow()'
/home/kom/android-ndk-r11/sources/cxx-stl/llvm-libc++/libcxx/include/ostream:758: error: undefined reference to 'std::__ndk1::ctype<char>::id'
/home/kom/android-ndk-r11/sources/cxx-stl/llvm-libc++/libcxx/include/ios:524: error: undefined reference to 'std::__ndk1::ios_base::clear(unsigned int)'
/home/kom/android-ndk-r11/sources/cxx-stl/llvm-libc++/libcxx/include/ostream:973: error: undefined reference to 'std::__ndk1::ios_base::__set_badbit_and_consider_rethrow()'
/home/kom/android-ndk-r11/sources/cxx-stl/llvm-libc++/libcxx/include/ostream:922: error: undefined reference to 'std::__ndk1::ios_base::__set_badbit_and_consider_rethrow()'
/home/kom/android-ndk-r11/sources/cxx-stl/llvm-libc++/libcxx/include/streambuf:163: error: undefined reference to 'std::__ndk1::locale::locale()'
/home/kom/android-ndk-r11/sources/cxx-stl/llvm-libc++/libcxx/include/streambuf:238: error: undefined reference to 'std::__ndk1::locale::locale(std::__ndk1::locale const&)'
/home/kom/android-ndk-r11/sources/cxx-stl/llvm-libc++/libcxx/include/__locale:166: error: undefined reference to 'std::__ndk1::locale::has_facet(std::__ndk1::locale::id&) const'
/home/kom/android-ndk-r11/sources/cxx-stl/llvm-libc++/libcxx/include/streambuf:238: error: undefined reference to 'std::__ndk1::locale::locale(std::__ndk1::locale const&)'
/home/kom/android-ndk-r11/sources/cxx-stl/llvm-libc++/libcxx/include/streambuf:220: error: undefined reference to 'std::__ndk1::codecvt<char, char, mbstate_t>::id'
/home/kom/android-ndk-r11/sources/cxx-stl/llvm-libc++/libcxx/include/istream:1624: error: undefined reference to 'std::__ndk1::ios_base::__set_badbit_and_consider_rethrow()'
/home/kom/android-ndk-r11/sources/cxx-stl/llvm-libc++/libcxx/include/istream:275: error: undefined reference to 'std::__ndk1::ctype<char>::id'
jni/CheckRuntime.cpp:41: error: undefined reference to 'std::__ndk1::cout'
jni/CheckRuntime.cpp:41: error: undefined reference to 'std::__ndk1::ctype<char>::id'
jni/LoadInputTensor.cpp:50: error: undefined reference to 'std::__ndk1::cout'
/home/kom/android-ndk-r11/sources/cxx-stl/llvm-libc++/libcxx/include/ios:668: error: undefined reference to 'std::__ndk1::ios_base::init(void*)'
/home/kom/android-ndk-r11/sources/cxx-stl/llvm-libc++/libcxx/include/streambuf:163: error: undefined reference to 'std::__ndk1::locale::locale()'
/home/kom/android-ndk-r11/sources/cxx-stl/llvm-libc++/libcxx/include/ostream:517: error: undefined reference to 'std::__ndk1::num_put<char, std::__ndk1::ostreambuf_iterator<char, std::__ndk1::char_traits<char> > >::id'
jni/LoadInputTensor.cpp:118: error: undefined reference to 'std::__ndk1::cout'
/home/kom/android-ndk-r11/sources/cxx-stl/llvm-libc++/libcxx/include/ios:668: error: undefined reference to 'std::__ndk1::ios_base::init(void*)'
/home/kom/android-ndk-r11/sources/cxx-stl/llvm-libc++/libcxx/include/fstream:1052: error: undefined reference to 'std::__ndk1::cerr'
/home/kom/android-ndk-r11/sources/cxx-stl/llvm-libc++/libcxx/include/fstream:1052: error: undefined reference to 'std::__ndk1::cerr'
/home/kom/android-ndk-r11/sources/cxx-stl/llvm-libc++/libcxx/include/memory:1636: error: undefined reference to 'std::__ndk1::cerr'
/home/kom/android-ndk-r11/sources/cxx-stl/llvm-libc++/libcxx/include/streambuf:163: error: undefined reference to 'std::__ndk1::locale::locale()'
/home/kom/android-ndk-r11/sources/cxx-stl/llvm-libc++/libcxx/include/streambuf:163: error: undefined reference to 'std::__ndk1::locale::locale()'
/home/kom/android-ndk-r11/sources/cxx-stl/llvm-libc++/libcxx/include/ostream:491: error: undefined reference to 'std::__ndk1::num_put<char, std::__ndk1::ostreambuf_iterator<char, std::__ndk1::char_traits<char> > >::id'
/home/kom/android-ndk-r11/sources/cxx-stl/llvm-libc++/libcxx/include/ostream:725: error: undefined reference to 'std::__ndk1::num_put<char, std::__ndk1::ostreambuf_iterator<char, std::__ndk1::char_traits<char> > >::id'
jni/CreateUserBuffer.cpp:54: error: undefined reference to 'std::runtime_error::runtime_error(std::__ndk1::basic_string<char, std::__ndk1::char_traits<char>, std::__ndk1::allocator<char> > const&)'
/home/kom/android-ndk-r11/sources/cxx-stl/llvm-libc++/libcxx/include/__hash_table:1944: error: undefined reference to 'std::__ndk1::__next_prime(unsigned int)'
/home/kom/android-ndk-r11/sources/cxx-stl/llvm-libc++/libcxx/include/__hash_table:1954: error: undefined reference to 'std::__ndk1::__next_prime(unsigned int)'
clang++: error: linker command failed with exit code 1 (use -v to see invocation)
/home/kom/android-ndk-r11/build/core/build-binary.mk:678: recipe for target 'obj/local/armeabi-v7a/snpe-sample' failed
make: *** [obj/local/armeabi-v7a/snpe-sample] Error 1
it worked.
I resolved it by del the libs and obj before ndk-build by other option.