3

这适用于 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_staticApplication.mk,因此,我home/tallen/eclipse/android-ndk-r8e/sources/cxx-stl/gnu-libstdc++/4.6/libs/armeabi-v7a/libgnustl_static.a在链接时看到我对 g++ (ld) 的论点。

4

1 回答 1

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,所以它也应该在那里工作)

于 2013-05-22T14:20:58.090 回答