这适用于8b但是从8c开始我得到:
rm -f ./libs/armeabi/lib*.so ./libs/armeabi-v7a/lib*.so ./libs/mips/lib*.so ./libs/x86/lib*.so
rm -f ./libs/armeabi/gdbserver ./libs/armeabi-v7a/gdbserver ./libs/mips/gdbserver ./libs/x86/gdbserver
rm -f ./libs/armeabi/gdb.setup ./libs/armeabi-v7a/gdb.setup ./libs/mips/gdb.setup ./libs/x86/gdb.setup
Gdbserver : [arm-linux-androideabi-4.6] libs/armeabi-v7a/gdbserver
install -p /home/tallen/eclipse/android-ndk-r8e/prebuilt/android-arm/gdbserver/gdbserver ./libs/armeabi-v7a/gdbserver
Gdbsetup : libs/armeabi-v7a/gdb.setup
echo "set solib-search-path ./obj/local/armeabi-v7a" > ./libs/armeabi-v7a/gdb.setup
echo "directory /home/tallen/eclipse/android-ndk-r8e/platforms/android-8/arch-arm/usr/include /home/tallen/eclipse/android-ndk-r8e/sources/cxx-stl/gnu-libstdc++ /home/tallen/eclipse/android-ndk-r8e/sources/cxx-stl/gnu-libstdc++/4.6/include /home/tallen/eclipse/android-ndk-r8e/sources/cxx-stl/gnu-libstdc++/4.6/libs/armeabi-v7a/include jni/NG1.4 jni/NG2.4" >> ./libs/armeabi-v7a/gdb.setup
SharedLibrary : libngapi1_4.so
/home/tallen/eclipse/android-ndk-r8e/toolchains/arm-linux-androideabi-4.6/prebuilt/linux-x86_64/bin/arm-linux-androideabi-g++ -Wl,-soname,libngapi1_4.so -shared --sysroot=/home/tallen/eclipse/android-ndk-r8e/platforms/android-8/arch-arm ./obj/local/armeabi-v7a/objs-debug/ngapi1_4/config.o ./obj/local/armeabi-v7a/objs-debug/ngapi1_4/ngroute.o ./obj/local/armeabi-v7a/objs-debug/ngapi1_4/ngreversegeocode.o ./obj/local/armeabi-v7a/objs-debug/ngapi1_4/ngugeosearch.o ./obj/local/armeabi-v7a/objs-debug/ngapi1_4/ngpoifinder.o ./obj/local/armeabi-v7a/objs-debug/ngapi1_4/ngumap.o ./obj/local/armeabi-v7a/objs-debug/ngapi1_4/NGUDataSource.o ./obj/local/armeabi-v7a/objs-debug/ngapi1_4/NGUBase.o ./obj/local/armeabi-v7a/objs-debug/ngapi1_4/NGUCameraBehavior.o ./obj/local/armeabi-v7a/objs-debug/ngapi1_4/NGUGeocode.o ./obj/local/armeabi-v7a/objs-debug/ngapi1_4/NGUImageCommon.o ./obj/local/armeabi-v7a/objs-debug/ngapi1_4/NGULocationHandler.o ./obj/local/armeabi-v7a/objs-debug/ngapi1_4/NGULocationInfo.o ./obj/local/armeabi-v7a/objs-debug/ngapi1_4/NGUMapContext.o ./obj/local/armeabi-v7a/objs-debug/ngapi1_4/NGUMapSettings.o ./obj/local/armeabi-v7a/objs-debug/ngapi1_4/NGUMapTools.o ./obj/local/armeabi-v7a/objs-debug/ngapi1_4/NGUNaviInfoManager.o ./obj/local/armeabi-v7a/objs-debug/ngapi1_4/NGUPoiSearch.o ./obj/local/armeabi-v7a/objs-debug/ngapi1_4/NGUPoiTypeManager.o ./obj/local/armeabi-v7a/objs-debug/ngapi1_4/NGUReverseGeocode.o ./obj/local/armeabi-v7a/objs-debug/ngapi1_4/NGURoute.o ./obj/local/armeabi-v7a/objs-debug/ngapi1_4/NGUStatusDecoder.o ./obj/local/armeabi-v7a/objs-debug/ngapi1_4/UnitFormatter.o ./obj/local/armeabi-v7a/objs-debug/ngapi1_4/NGUMapView.o /home/tallen/eclipse/android-ndk-r8e/sources/cxx-stl/gnu-libstdc++/4.6/libs/armeabi-v7a/libgnustl_static.a -lgcc -no-canonical-prefixes -march=armv7-a -Wl,--fix-cortex-a8 -Wl,--no-undefined -Wl,-z,noexecstack -Wl,-z,relro -Wl,-z,now -L/home/tallen/eclipse/android-ndk-r8e/platforms/android-8/arch-arm/usr/lib -ldl -lz -lGLESv2 -llog -Ljni/NG1.4/lib -lNGMap -lNGDataSource -lNGMap -lNGGeocode -lNGRoute -lNGReverseGeocode -lNGMapSearch -lNGGpsFilter -lNGDataSource -lNGBase -lpng jni/NG1.4/thirdparty/lib/libcurl.a jni/NG1.4/thirdparty/lib/libxml2.a -lc -lm -o ./obj/local/armeabi-v7a/libngapi1_4.so
/home/tallen/eclipse/android-ndk-r8e/toolchains/arm-linux-androideabi-4.6/prebuilt/linux-x86_64/bin/../lib/gcc/arm-linux-androideabi/4.6/../../../../arm-linux-androideabi/bin/ld: jni/NG1.4/lib/libNGMap.a(debug.o): in function Options::Load():./../../../../../libraries/gnu-libstdc++/include/ext/atomicity.h:79: error: undefined reference to '__gnu_cxx::__exchange_and_add(int volatile*, int)'
/home/tallen/eclipse/android-ndk-r8e/toolchains/arm-linux-androideabi-4.6/prebuilt/linux-x86_64/bin/../lib/gcc/arm-linux-androideabi/4.6/../../../../arm-linux-androideabi/bin/ld: jni/NG1.4/lib/libNGMap.a(glbgl_ogl.o): in function GLB::OGL_renderer::Config::~Config():./../../../../../libraries/gnu-libstdc++/include/ext/atomicity.h:79: error: undefined reference to '__gnu_cxx::__exchange_and_add(int volatile*, int)'
/home/tallen/eclipse/android-ndk-r8e/toolchains/arm-linux-androideabi-4.6/prebuilt/linux-x86_64/bin/../lib/gcc/arm-linux-androideabi/4.6/../../../../arm-linux-androideabi/bin/ld: jni/NG1.4/lib/libNGMap.a(glbgl_ogl.o): in function GLB::OGL_renderer::Config::~Config():./../../../../../libraries/gnu-libstdc++/include/ext/atomicity.h:79: error: undefined reference to '__gnu_cxx::__exchange_and_add(int volatile*, int)'
/home/tallen/eclipse/android-ndk-r8e/toolchains/arm-linux-androideabi-4.6/prebuilt/linux-x86_64/bin/../lib/gcc/arm-linux-androideabi/4.6/../../../../arm-linux-androideabi/bin/ld: jni/NG1.4/lib/libNGMap.a(glbgl_ogl.o): in function GLB::OGL_renderer::Config::~Config():./../../../../../libraries/gnu-libstdc++/include/ext/atomicity.h:79: error: undefined reference to '__gnu_cxx::__exchange_and_add(int volatile*, int)'
/home/tallen/eclipse/android-ndk-r8e/toolchains/arm-linux-androideabi-4.6/prebuilt/linux-x86_64/bin/../lib/gcc/arm-linux-androideabi/4.6/../../../../arm-linux-androideabi/bin/ld: jni/NG1.4/lib/libNGMap.a(engine.o): in function GLB::Engine::RemoveUnusedQuads():./../../../../../libraries/gnu-libstdc++/include/bits/stl_list.h:1424: error: undefined reference to 'std::_List_node_base::unhook()'
/home/tallen/eclipse/android-ndk-r8e/toolchains/arm-linux-androideabi-4.6/prebuilt/linux-x86_64/bin/../lib/gcc/arm-linux-androideabi/4.6/../../../../arm-linux-androideabi/bin/ld: jni/NG1.4/lib/libNGMap.a(engine.o): in function GLB::Engine::deleteRouteMapObject():./../../../../../libraries/gnu-libstdc++/include/bits/stl_list.h:1424: error: undefined reference to 'std::_List_node_base::unhook()'
/home/tallen/eclipse/android-ndk-r8e/toolchains/arm-linux-androideabi-4.6/prebuilt/linux-x86_64/bin/../lib/gcc/arm-linux-androideabi/4.6/../../../../arm-linux-androideabi/bin/ld: jni/NG1.4/lib/libNGMap.a(engine.o): in function GLB::Engine::createMapObjectRoute(counted_ptr<GLB::Route>):./../../../../../libraries/gnu-libstdc++/include/bits/stl_list.h:1408: error: undefined reference to 'std::_List_node_base::hook(std::_List_node_base*)'
/home/tallen/eclipse/android-ndk-r8e/toolchains/arm-linux-androideabi-4.6/prebuilt/linux-x86_64/bin/../lib/gcc/arm-linux-androideabi/4.6/../../../../arm-linux-androideabi/bin/ld: jni/NG1.4/lib/libNGMap.a(engine.o): in function GLB::Engine::AddRenderQuad(counted_ptr<GLB::RenderQuad>):./../../../../../libraries/gnu-libstdc++/include/bits/stl_list.h:1408: error: undefined reference to 'std::_List_node_base::hook(std::_List_node_base*)'
/home/tallen/eclipse/android-ndk-r8e/toolchains/arm-linux-androideabi-4.6/prebuilt/linux-x86_64/bin/../lib/gcc/arm-linux-androideabi/4.6/../../../../arm-linux-androideabi/bin/ld: jni/NG1.4/lib/libNGMap.a(engine.o): in function GLB::Engine::AddRenderQuad(counted_ptr<GLB::RenderQuad>):./../../../../../libraries/gnu-libstdc++/include/bits/stl_list.h:1408: error: undefined reference to 'std::_List_node_base::hook(std::_List_node_base*)'
/home/tallen/eclipse/android-ndk-r8e/toolchains/arm-linux-androideabi-4.6/prebuilt/linux-x86_64/bin/../lib/gcc/arm-linux-androideabi/4.6/../../../../arm-linux-androideabi/bin/ld: jni/NG1.4/lib/libNGMap.a(renderquad.o): in function GLB::RenderQuad::removeRenderablesWithObjectId(int):./../../../../../libraries/gnu-libstdc++/include/bits/stl_list.h:1424: error: undefined reference to 'std::_List_node_base::unhook()'
/home/tallen/eclipse/android-ndk-r8e/toolchains/arm-linux-androideabi-4.6/prebuilt/linux-x86_64/bin/../lib/gcc/arm-linux-androideabi/4.6/../../../../arm-linux-androideabi/bin/ld: jni/NG1.4/lib/libNGMap.a(mapobjectpoint.o): in function MapObjectPoint::getRenderablesForQuad(GLB::QuadIdx const&, std::list<counted_ptr<GLB::Renderable>, std::allocator<counted_ptr<GLB::Renderable> > >&):./../../../../../libraries/gnu-libstdc++/include/bits/stl_list.h:1408: error: undefined reference to 'std::_List_node_base::hook(std::_List_node_base*)'
/home/tallen/eclipse/android-ndk-r8e/toolchains/arm-linux-androideabi-4.6/prebuilt/linux-x86_64/bin/../lib/gcc/arm-linux-androideabi/4.6/../../../../arm-linux-androideabi/bin/ld: jni/NG1.4/lib/libNGMap.a(vertexbuffer.o): in function global constructors keyed to vertexbuffer.cpp:./../../../../../libraries/gnu-libstdc++/include/iostream:72: error: undefined reference to 'std::ios_base::Init::Init()'
/home/tallen/eclipse/android-ndk-r8e/toolchains/arm-linux-androideabi-4.6/prebuilt/linux-x86_64/bin/../lib/gcc/arm-linux-androideabi/4.6/../../../../arm-linux-androideabi/bin/ld: jni/NG1.4/lib/libNGMap.a(vertexbuffer.o): in function global constructors keyed to vertexbuffer.cpp:./../../../../glbogl/src/vertexbuffer.cpp:66: error: undefined reference to 'std::ios_base::Init::~Init()'
/home/tallen/eclipse/android-ndk-r8e/toolchains/arm-linux-androideabi-4.6/prebuilt/linux-x86_64/bin/../lib/gcc/arm-linux-androideabi/4.6/../../../../arm-linux-androideabi/bin/ld: jni/NG1.4/lib/libNGDataSource.a(ngrenderablebuilder.o): in function std::list<counted_ptr<GLB::Renderable>, std::allocator<counted_ptr<GLB::Renderable> > >::merge(std::list<counted_ptr<GLB::Renderable>, std::allocator<counted_ptr<GLB::Renderable> > >&):/Users/jenkins/.jenkins/workspace_sdk/0/NaviGenie/NGDataSource/project/android/jni/../../../../../libraries/gnu-libstdc++/include/bits/stl_list.h:1400: error: undefined reference to 'std::_List_node_base::transfer(std::_List_node_base*, std::_List_node_base*)'
/home/tallen/eclipse/android-ndk-r8e/toolchains/arm-linux-androideabi-4.6/prebuilt/linux-x86_64/bin/../lib/gcc/arm-linux-androideabi/4.6/../../../../arm-linux-androideabi/bin/ld: jni/NG1.4/lib/libNGDataSource.a(ngrenderablebuilder.o): in function std::list<counted_ptr<GLB::Renderable>, std::allocator<counted_ptr<GLB::Renderable> > >::merge(std::list<counted_ptr<GLB::Renderable>, std::allocator<counted_ptr<GLB::Renderable> > >&):/Users/jenkins/.jenkins/workspace_sdk/0/NaviGenie/NGDataSource/project/android/jni/../../../../../libraries/gnu-libstdc++/include/bits/stl_list.h:1400: error: undefined reference to 'std::_List_node_base::transfer(std::_List_node_base*, std::_List_node_base*)'
/home/tallen/eclipse/android-ndk-r8e/toolchains/arm-linux-androideabi-4.6/prebuilt/linux-x86_64/bin/../lib/gcc/arm-linux-androideabi/4.6/../../../../arm-linux-androideabi/bin/ld: jni/NG1.4/lib/libNGDataSource.a(ngrenderablebuilder.o): in function std::list<counted_ptr<GLB::Renderable>, std::allocator<counted_ptr<GLB::Renderable> > >::sort():/Users/jenkins/.jenkins/workspace_sdk/0/NaviGenie/NGDataSource/project/android/jni/../../../../../libraries/gnu-libstdc++/include/bits/stl_list.h:1400: error: undefined reference to 'std::_List_node_base::transfer(std::_List_node_base*, std::_List_node_base*)'
/home/tallen/eclipse/android-ndk-r8e/toolchains/arm-linux-androideabi-4.6/prebuilt/linux-x86_64/bin/../lib/gcc/arm-linux-androideabi/4.6/../../../../arm-linux-androideabi/bin/ld: jni/NG1.4/lib/libNGDataSource.a(ngrenderablebuilder.o): in function std::list<counted_ptr<GLB::Renderable>, std::allocator<counted_ptr<GLB::Renderable> > >::sort():/Users/jenkins/.jenkins/workspace_sdk/0/NaviGenie/NGDataSource/project/android/jni/../../../../../libraries/gnu-libstdc++/include/bits/stl_list.h:1115: error: undefined reference to 'std::_List_node_base::swap(std::_List_node_base&, std::_List_node_base&)'
/home/tallen/eclipse/android-ndk-r8e/toolchains/arm-linux-androideabi-4.6/prebuilt/linux-x86_64/bin/../lib/gcc/arm-linux-androideabi/4.6/../../../../arm-linux-androideabi/bin/ld: jni/NG1.4/lib/libNGDataSource.a(ngrenderablebuilder.o): in function std::list<counted_ptr<GLB::Renderable>, std::allocator<counted_ptr<GLB::Renderable> > >::sort():/Users/jenkins/.jenkins/workspace_sdk/0/NaviGenie/NGDataSource/project/android/jni/../../../../../libraries/gnu-libstdc++/include/bits/stl_list.h:1115: error: undefined reference to 'std::_List_node_base::swap(std::_List_node_base&, std::_List_node_base&)'
/home/tallen/eclipse/android-ndk-r8e/toolchains/arm-linux-androideabi-4.6/prebuilt/linux-x86_64/bin/../lib/gcc/arm-linux-androideabi/4.6/../../../../arm-linux-androideabi/bin/ld: jni/NG1.4/lib/libNGDataSource.a(ngrenderablebuilder.o): in function std::list<counted_ptr<GLB::Renderable>, std::allocator<counted_ptr<GLB::Renderable> > >::sort():/Users/jenkins/.jenkins/workspace_sdk/0/NaviGenie/NGDataSource/project/android/jni/../../../../../libraries/gnu-libstdc++/include/bits/stl_list.h:1115: error: undefined reference to 'std::_List_node_base::swap(std::_List_node_base&, std::_List_node_base&)'
/home/tallen/eclipse/android-ndk-r8e/toolchains/arm-linux-androideabi-4.6/prebuilt/linux-x86_64/bin/../lib/gcc/arm-linux-androideabi/4.6/../../../../arm-linux-androideabi/bin/ld: jni/NG1.4/lib/libNGDataSource.a(ngntorenderline.o): in function global constructors keyed to ngntorenderline.cpp:/Users/jenkins/.jenkins/workspace_sdk/0/NaviGenie/NGDataSource/project/android/jni/../../../../../libraries/gnu-libstdc++/include/iostream:72: error: undefined reference to 'std::ios_base::Init::Init()'
/home/tallen/eclipse/android-ndk-r8e/toolchains/arm-linux-androideabi-4.6/prebuilt/linux-x86_64/bin/../lib/gcc/arm-linux-androideabi/4.6/../../../../arm-linux-androideabi/bin/ld: jni/NG1.4/lib/libNGDataSource.a(ngntorenderline.o): in function global constructors keyed to ngntorenderline.cpp:/Users/jenkins/.jenkins/workspace_sdk/0/NaviGenie/NGDataSource/project/android/jni/../../../src/NGNBuilder/ngntorenderline.cpp:94: error: undefined reference to 'std::ios_base::Init::~Init()'
/home/tallen/eclipse/android-ndk-r8e/toolchains/arm-linux-androideabi-4.6/prebuilt/linux-x86_64/bin/../lib/gcc/arm-linux-androideabi/4.6/../../../../arm-linux-androideabi/bin/ld: jni/NG1.4/lib/libNGDataSource.a(ngntorenderstreet.o): in function global constructors keyed to ngntorenderstreet.cpp:/Users/jenkins/.jenkins/workspace_sdk/0/NaviGenie/NGDataSource/project/android/jni/../../../../../libraries/gnu-libstdc++/include/iostream:72: error: undefined reference to 'std::ios_base::Init::Init()'
/home/tallen/eclipse/android-ndk-r8e/toolchains/arm-linux-androideabi-4.6/prebuilt/linux-x86_64/bin/../lib/gcc/arm-linux-androideabi/4.6/../../../../arm-linux-androideabi/bin/ld: jni/NG1.4/lib/libNGDataSource.a(ngntorenderstreet.o): in function global constructors keyed to ngntorenderstreet.cpp:/Users/jenkins/.jenkins/workspace_sdk/0/NaviGenie/NGDataSource/project/android/jni/../../../src/NGNBuilder/ngntorenderstreet.cpp:1508: error: undefined reference to 'std::ios_base::Init::~Init()'
/home/tallen/eclipse/android-ndk-r8e/toolchains/arm-linux-androideabi-4.6/prebuilt/linux-x86_64/bin/../lib/gcc/arm-linux-androideabi/4.6/../../../../arm-linux-androideabi/bin/ld: jni/NG1.4/lib/libNGDataSource.a(ngntorenderstreet.o): in function StreetGeometry::Algorithm::~Algorithm():/Users/jenkins/.jenkins/workspace_sdk/0/NaviGenie/NGDataSource/project/android/jni/../../../src/NGNBuilder/graph.h:57: error: undefined reference to 'std::basic_ofstream<char, std::char_traits<char> >::~basic_ofstream()'
/home/tallen/eclipse/android-ndk-r8e/toolchains/arm-linux-androideabi-4.6/prebuilt/linux-x86_64/bin/../lib/gcc/arm-linux-androideabi/4.6/../../../../arm-linux-androideabi/bin/ld: jni/NG1.4/lib/libNGDataSource.a(extractboundary.o): in function extractBoundaryToTrianglesAndLineStrip(NGNConvexBoundary const&, std::vector<unsigned short, std::allocator<unsigned short> >&, std::vector<unsigned short, std::allocator<unsigned short> >&, std::list<std::pair<int, int>, std::allocator<std::pair<int, int> > >&):/Users/jenkins/.jenkins/workspace_sdk/0/NaviGenie/NGDataSource/project/android/jni/../../../../../libraries/gnu-libstdc++/include/bits/stl_list.h:1424: error: undefined reference to 'std::_List_node_base::unhook()'
/home/tallen/eclipse/android-ndk-r8e/toolchains/arm-linux-androideabi-4.6/prebuilt/linux-x86_64/bin/../lib/gcc/arm-linux-androideabi/4.6/../../../../arm-linux-androideabi/bin/ld: jni/NG1.4/lib/libNGDataSource.a(graph.o): in function global constructors keyed to graph.cpp:/Users/jenkins/.jenkins/workspace_sdk/0/NaviGenie/NGDataSource/project/android/jni/../../../../../libraries/gnu-libstdc++/include/iostream:72: error: undefined reference to 'std::ios_base::Init::Init()'
/home/tallen/eclipse/android-ndk-r8e/toolchains/arm-linux-androideabi-4.6/prebuilt/linux-x86_64/bin/../lib/gcc/arm-linux-androideabi/4.6/../../../../arm-linux-androideabi/bin/ld: jni/NG1.4/lib/libNGDataSource.a(graph.o): in function global constructors keyed to graph.cpp:/Users/jenkins/.jenkins/workspace_sdk/0/NaviGenie/NGDataSource/project/android/jni/../../../src/NGNBuilder/graph.cpp:614: error: undefined reference to 'std::ios_base::Init::~Init()'
/home/tallen/eclipse/android-ndk-r8e/toolchains/arm-linux-androideabi-4.6/prebuilt/linux-x86_64/bin/../lib/gcc/arm-linux-androideabi/4.6/../../../../arm-linux-androideabi/bin/ld: jni/NG1.4/lib/libNGDataSource.a(graph.o): in function StreetGeometry::Algorithm::triagonalize(float, GLB::_VertexArray*, GLB::_VertexArray*):/Users/jenkins/.jenkins/workspace_sdk/0/NaviGenie/NGDataSource/project/android/jni/../../../../../libraries/gnu-libstdc++/include/fstream:738: error: undefined reference to 'std::basic_filebuf<char, std::char_traits<char> >::close()'
/home/tallen/eclipse/android-ndk-r8e/toolchains/arm-linux-androideabi-4.6/prebuilt/linux-x86_64/bin/../lib/gcc/arm-linux-androideabi/4.6/../../../../arm-linux-androideabi/bin/ld: jni/NG1.4/lib/libNGDataSource.a(graph.o): in function StreetGeometry::Algorithm::Algorithm():/Users/jenkins/.jenkins/workspace_sdk/0/NaviGenie/NGDataSource/project/android/jni/../../../src/NGNBuilder/graph.cpp:241: error: undefined reference to 'std::basic_ofstream<char, std::char_traits<char> >::basic_ofstream()'
/home/tallen/eclipse/android-ndk-r8e/toolchains/arm-linux-androideabi-4.6/prebuilt/linux-x86_64/bin/../lib/gcc/arm-linux-androideabi/4.6/../../../../arm-linux-androideabi/bin/ld: jni/NG1.4/lib/libNGDataSource.a(graph.o): in function StreetGeometry::Algorithm::Algorithm():/Users/jenkins/.jenkins/workspace_sdk/0/NaviGenie/NGDataSource/project/android/jni/../../../src/NGNBuilder/graph.cpp:244: error: undefined reference to 'std::basic_ofstream<char, std::char_traits<char> >::~basic_ofstream()'
/home/tallen/eclipse/android-ndk-r8e/toolchains/arm-linux-androideabi-4.6/prebuilt/linux-x86_64/bin/../lib/gcc/arm-linux-androideabi/4.6/../../../../arm-linux-androideabi/bin/ld: jni/NG1.4/lib/libNGDataSource.a(graph.o): in function StreetGeometry::Algorithm::Algorithm():/Users/jenkins/.jenkins/workspace_sdk/0/NaviGenie/NGDataSource/project/android/jni/../../../src/NGNBuilder/graph.cpp:241: error: undefined reference to 'std::basic_ofstream<char, std::char_traits<char> >::basic_ofstream()'
/home/tallen/eclipse/android-ndk-r8e/toolchains/arm-linux-androideabi-4.6/prebuilt/linux-x86_64/bin/../lib/gcc/arm-linux-androideabi/4.6/../../../../arm-linux-androideabi/bin/ld: jni/NG1.4/lib/libNGDataSource.a(graph.o): in function StreetGeometry::Algorithm::Algorithm():/Users/jenkins/.jenkins/workspace_sdk/0/NaviGenie/NGDataSource/project/android/jni/../../../src/NGNBuilder/graph.cpp:244: error: undefined reference to 'std::basic_ofstream<char, std::char_traits<char> >::~basic_ofstream()'
/home/tallen/eclipse/android-ndk-r8e/toolchains/arm-linux-androideabi-4.6/prebuilt/linux-x86_64/bin/../lib/gcc/arm-linux-androideabi/4.6/../../../../arm-linux-androideabi/bin/ld: jni/NG1.4/lib/libNGGeocode.a(geocode.o): in function CharacterUtils::utf8ToAscii(std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&):/android/android-ndk-r6b/sources/cxx-stl/gnu-libstdc++/include/ostream:113: error: undefined reference to 'std::cout'
/home/tallen/eclipse/android-ndk-r8e/toolchains/arm-linux-androideabi-4.6/prebuilt/linux-x86_64/bin/../lib/gcc/arm-linux-androideabi/4.6/../../../../arm-linux-androideabi/bin/ld: jni/NG1.4/lib/libNGGeocode.a(geocodehousenumbers.o): in function Geocode::searchHouseNumber(AddressCollection&):/Users/jenkins/.jenkins/workspace_sdk/0/NaviGenie/NGGeocode/projects/android/jni/../../../src/geocodehousenumbers.cpp:590: error: undefined reference to 'std::cerr'
/home/tallen/eclipse/android-ndk-r8e/toolchains/arm-linux-androideabi-4.6/prebuilt/linux-x86_64/bin/../lib/gcc/arm-linux-androideabi/4.6/../../../../arm-linux-androideabi/bin/ld: jni/NG1.4/lib/libNGGeocode.a(fullfile.o): in function FullFile::loadLevelBorders():/android/android-ndk-r6b/sources/cxx-stl/gnu-libstdc++/include/fstream:455: error: undefined reference to 'std::basic_filebuf<char, std::char_traits<char> >::basic_filebuf()'
/home/tallen/eclipse/android-ndk-r8e/toolchains/arm-linux-androideabi-4.6/prebuilt/linux-x86_64/bin/../lib/gcc/arm-linux-androideabi/4.6/../../../../arm-linux-androideabi/bin/ld: jni/NG1.4/lib/libNGGeocode.a(fullfile.o): in function FullFile::loadLevelBorders():/android/android-ndk-r6b/sources/cxx-stl/gnu-libstdc++/include/fstream:527: error: undefined reference to 'std::basic_filebuf<char, std::char_traits<char> >::open(char const*, std::_Ios_Openmode)'
/home/tallen/eclipse/android-ndk-r8e/toolchains/arm-linux-androideabi-4.6/prebuilt/linux-x86_64/bin/../lib/gcc/arm-linux-androideabi/4.6/../../../../arm-linux-androideabi/bin/ld: jni/NG1.4/lib/libNGGeocode.a(fullfile.o): in function FullFile::loadLevelBorders():/Users/jenkins/.jenkins/workspace_sdk/0/NaviGenie/NGGeocode/projects/android/jni/../../../src/fullfile.cpp:120: error: undefined reference to 'std::basic_ifstream<char, std::char_traits<char> >::~basic_ifstream()'
/home/tallen/eclipse/android-ndk-r8e/toolchains/arm-linux-androideabi-4.6/prebuilt/linux-x86_64/bin/../lib/gcc/arm-linux-androideabi/4.6/../../../../arm-linux-androideabi/bin/ld: jni/NG1.4/lib/libNGGeocode.a(fullfile.o): in function FullFile::loadLevelBorders():/Users/jenkins/.jenkins/workspace_sdk/0/NaviGenie/NGGeocode/projects/android/jni/../../../src/fullfile.cpp:120: error: undefined reference to 'std::basic_ifstream<char, std::char_traits<char> >::~basic_ifstream()'
/home/tallen/eclipse/android-ndk-r8e/toolchains/arm-linux-androideabi-4.6/prebuilt/linux-x86_64/bin/../lib/gcc/arm-linux-androideabi/4.6/../../../../arm-linux-androideabi/bin/ld: jni/NG1.4/lib/libNGGeocode.a(fullfile.o): in function FullFile::loadLevelBorders():/android/android-ndk-r6b/sources/cxx-stl/gnu-libstdc++/include/fstream:458: error: undefined reference to 'std::basic_filebuf<char, std::char_traits<char> >::~basic_filebuf()'
/home/tallen/eclipse/android-ndk-r8e/toolchains/arm-linux-androideabi-4.6/prebuilt/linux-x86_64/bin/../lib/gcc/arm-linux-androideabi/4.6/../../../../arm-linux-androideabi/bin/ld: jni/NG1.4/lib/libNGGeocode.a(fullfile.o): in function FullFile::loadLevelBorders():/android/android-ndk-r6b/sources/cxx-stl/gnu-libstdc++/include/fstream:458: error: undefined reference to 'VTT for std::basic_ifstream<char, std::char_traits<char> >'
/home/tallen/eclipse/android-ndk-r8e/toolchains/arm-linux-androideabi-4.6/prebuilt/linux-x86_64/bin/../lib/gcc/arm-linux-androideabi/4.6/../../../../arm-linux-androideabi/bin/ld: jni/NG1.4/lib/libNGGeocode.a(fullfile.o): in function FullFile::loadLevelBorders():/android/android-ndk-r6b/sources/cxx-stl/gnu-libstdc++/include/fstream:458: error: undefined reference to 'vtable for std::basic_ifstream<char, std::char_traits<char> >'
/home/tallen/eclipse/android-ndk-r8e/toolchains/arm-linux-androideabi-4.6/prebuilt/linux-x86_64/bin/../lib/gcc/arm-linux-androideabi/4.6/../../../../arm-linux-androideabi/bin/ld: jni/NG1.4/lib/libNGRoute.a(streetgraph.o): in function ng::route::StreetGraph::Quad::print(bool, bool) const:/Users/jenkins/.jenkins/workspace_sdk/0/NaviGenie/NGRoute/project/android/jni/../../../src/detail_routing/streetgraph.cpp:367: error: undefined reference to 'std::cout'
/home/tallen/eclipse/android-ndk-r8e/toolchains/arm-linux-androideabi-4.6/prebuilt/linux-x86_64/bin/../lib/gcc/arm-linux-androideabi/4.6/../../../../arm-linux-androideabi/bin/ld: jni/NG1.4/lib/libNGRoute.a(streetgraph.o): in function ng::route::StreetGraph::Quad::printRestrictions() const:/Users/jenkins/.jenkins/workspace_sdk/0/NaviGenie/NGRoute/project/android/jni/../../../src/detail_routing/streetgraph.cpp:381: error: undefined reference to 'std::cout'
/home/tallen/eclipse/android-ndk-r8e/toolchains/arm-linux-androideabi-4.6/prebuilt/linux-x86_64/bin/../lib/gcc/arm-linux-androideabi/4.6/../../../../arm-linux-androideabi/bin/ld: jni/NG1.4/lib/libNGRoute.a(streetgraph.o): in function ng::route::StreetGraph::DataSourceQuadLoader::load(int, int, unsigned int):/Users/jenkins/.jenkins/workspace_sdk/0/NaviGenie/NGRoute/project/android/jni/../../../src/detail_routing/streetgraph.cpp:601: error: undefined reference to 'std::cout'
collect2: ld returned 1 exit status
make: *** [obj/local/armeabi-v7a/libngapi1_4.so] Error 1
现在大部分内容都不是很有趣但是有一个反复出现的主题是对libgnustl_static
中应该包含的内容的未定义引用。但是我的APP_STL := gnustl_static
看起来Application.mk
,因此,在链接时我的g ++(ld)参数中看到home/tallen/eclipse/android-ndk-r8e/sources/cxx-stl/gnu-libstdc++/4.6/libs/armeabi-v7a/libgnustl_static.a
。
答案 0 :(得分:12)
APP_STL:= gnustl_static在NDK 8c到8e中被破坏,并在一个人的Application.mk中使用它导致正确的包含;但是,库$(NDK_BUILD)/sources/cxx-stl/gnu-libstdc++/4.6/libs/armeabi-v7a/libgnustl_static.a
在g ++(ld)参数中包含得太早了,在链接静态库时,顺序很重要(参见gcc文档等)。
以下是我修复它的方法(在Linux(64),Cygwin和Windows上测试):
从您的Application.mk中删除说APP_STL := gnustl_static
的行,我放弃了它,它在NDK中被破坏(从8c到8e开始);此外,它在Linux,Cygwin和Windows上略有不同。具体来说,它将$(NDK_ROOT)/sources/cxx-stl/gnu-libstdc++/4.6/libs/armeabi-v7a/libgnustl_static.a
放在g ++的参数中太早了
向Andriod.mk
添加三行:
LOCAL_C_INCLUDES := $(NDK_ROOT)/sources/cxx-stl/gnu-libstdc++/4.6/include
LOCAL_C_INCLUDES += $(NDK_ROOT)/sources/cxx-stl/gnu-libstdc++/4.6/libs/armeabi-v7a/include
LOCAL_LDLIBS += $(NDK_ROOT)/sources/cxx-stl/gnu-libstdc++/4.6/libs/armeabi-v7a/libgnustl_static.a`
最后一行必须添加到LOCAL_LDLIBS
。
前言将完成APP_STL := gnustl_static
Application.mk
的所有内容。
还有其他方法可以解决这个问题,但这是我发现可以在Linux,Cygwin和Windows上运行的唯一方法(我没有使用OS X进行测试,但OS X是一个unix所以它也应该在那里工作)