查看: 4257|回复: 8

在android上编译osg的两个例子程序时出错

[复制链接]

该用户从未签到

发表于 2012-7-18 11:37:25 | 显示全部楼层 |阅读模式
我的osg版本是3.0.1,NDK版本是android-ndk-r8,我按照网上的方法在cygwin下用cmake将osg编译成功,但当我用eclipse+cdt+NDK编译例子程序时出现很多错误,好像是关于stl的错误,在网上查说是把将application.mk的APP_STL改了就行,可是我把所有能用的几个值都试了还是不行,请教各位高手我该怎么做,错误如下所示,只贴一部分,其实有一大堆类似的
  1. D:/android/android-ndk-r8/sources/cxx-stl/gnu-libstdc++/include/ext/new_allocator.h:87: undefined reference to `std::__throw_bad_alloc()'
  2. D:/OSGEarthVS/OpenSceneGraph-3.0.1/build/obj/local/armeabi\libosg.a(View.o): In function `_Vector_base':
  3. D:/android/android-ndk-r8/sources/cxx-stl/gnu-libstdc++/include/bits/stl_vector.h:115: undefined reference to `__cxa_end_cleanup'
  4. D:/OSGEarthVS/OpenSceneGraph-3.0.1/build/obj/local/armeabi\libosg.a(View.o):(.ARM.extab.text._ZNSt6vectorIN3osg4View5SlaveESaIS2_EEC1ERKS4_[std::vector<osg::View::Slave, std::allocator<osg::View::Slave> >::vector(std::vector<osg::View::Slave, std::allocator<osg::View::Slave> > const&)]+0x0): undefined reference to `__gxx_personality_v0'
  5. D:/OSGEarthVS/OpenSceneGraph-3.0.1/build/obj/local/armeabi\libosg.a(View.o): In function `~ref_ptr':
  6. D:/OSGEarthVS/OpenSceneGraph-3.0.1/include/osg/ref_ptr:35: undefined reference to `__cxa_end_cleanup'
  7. D:/OSGEarthVS/OpenSceneGraph-3.0.1/build/obj/local/armeabi\libosg.a(View.o):(.ARM.extab.text._ZN3osg4ViewC2ERKS0_RKNS_6CopyOpE+0x0): undefined reference to `__gxx_personality_v0'
  8. D:/OSGEarthVS/OpenSceneGraph-3.0.1/build/obj/local/armeabi\libosg.a(View.o): In function `View':
  9. D:/OSGEarthVS/OpenSceneGraph-3.0.1/src/osg/View.cpp:50: undefined reference to `__cxa_end_cleanup'
  10. D:/OSGEarthVS/OpenSceneGraph-3.0.1/build/obj/local/armeabi\libosg.a(View.o):(.ARM.extab.text._ZN3osg4ViewC1ERKS0_RKNS_6CopyOpE+0x0): undefined reference to `__gxx_personality_v0'
  11. D:/OSGEarthVS/OpenSceneGraph-3.0.1/build/obj/local/armeabi\libosg.a(View.o): In function `std::_Vector_base<osg::View::Slave, std::allocator<osg::View::Slave> >::_M_allocate(unsigned int)':
  12. D:/android/android-ndk-r8/sources/cxx-stl/gnu-libstdc++/include/ext/new_allocator.h:87: undefined reference to `std::__throw_bad_alloc()'
  13. D:/OSGEarthVS/OpenSceneGraph-3.0.1/build/obj/local/armeabi\libosg.a(View.o): In function `osg::View::setLightingMode(osg::View::LightingMode)':
  14. D:/OSGEarthVS/OpenSceneGraph-3.0.1/src/osg/View.cpp:116: undefined reference to `__cxa_end_cleanup'
  15. D:/OSGEarthVS/OpenSceneGraph-3.0.1/build/obj/local/armeabi\libosg.a(View.o):(.ARM.extab.text._ZN3osg4View15setLightingModeENS0_12LightingModeE+0x0): undefined reference to `__gxx_personality_v0'
  16. D:/OSGEarthVS/OpenSceneGraph-3.0.1/build/obj/local/armeabi\libosg.a(View.o): In function `~ref_ptr':
  17. D:/OSGEarthVS/OpenSceneGraph-3.0.1/include/osg/ref_ptr:35: undefined reference to `__cxa_end_cleanup'
  18. D:/OSGEarthVS/OpenSceneGraph-3.0.1/build/obj/local/armeabi\libosg.a(View.o):(.ARM.extab.text._ZN3osg4ViewC2Ev+0x0): undefined reference to `__gxx_personality_v0'
  19. D:/OSGEarthVS/OpenSceneGraph-3.0.1/build/obj/local/armeabi\libosg.a(View.o): In function `View':
  20. D:/OSGEarthVS/OpenSceneGraph-3.0.1/src/osg/View.cpp:41: undefined reference to `__cxa_end_cleanup'
  21. D:/OSGEarthVS/OpenSceneGraph-3.0.1/src/osg/View.cpp:41: undefined reference to `std::string::_Rep::_S_empty_rep_storage'
复制代码

该用户从未签到

发表于 2012-7-19 14:03:22 | 显示全部楼层
不懂,帮顶,楼主要是编译好了,希望发一发心得

该用户从未签到

发表于 2012-8-10 00:36:53 | 显示全部楼层
帮顶,我也正在编译,遇到如下错误:
xuhy@xuhy-PC /cygdrive/f/osgeo4w/osg/trunk/OpenSceneGraph
$ make all
Scanning dependencies of target ndk
[100%] Generating Android-OpenSceneGraph
make[2]: ANDROID_NDK-NOTFOUND/ndk-build: Command not found
CMakeFiles/ndk.dir/build.make:52: recipe for target `Android-OpenSceneGraph' failed
make[2]: *** [Android-OpenSceneGraph] Error 127
CMakeFiles/Makefile2:60: recipe for target `CMakeFiles/ndk.dir/all' failed
make[1]: *** [CMakeFiles/ndk.dir/all] Error 2
Makefile:113: recipe for target `all' failed
make: *** [all] Error 2

该用户从未签到

发表于 2012-8-15 16:25:16 | 显示全部楼层
hi,楼主,我也遇到这个问题,不知道你解决了没有,帮忙指导下

该用户从未签到

发表于 2012-8-15 16:29:01 | 显示全部楼层
我编译成功了,你把Android.mk中改为
LOCAL_LDLIBS    := -llog -lGLESv2 -lz -lgnustl_static
试试

该用户从未签到

发表于 2013-6-14 13:46:13 | 显示全部楼层
楼主,我也遇到了,你是怎么解决的?:(:(:(:(

该用户从未签到

发表于 2014-7-17 12:26:17 | 显示全部楼层
xuhaiyan8825 发表于 2012-8-10 00:36
帮顶,我也正在编译,遇到如下错误:
xuhy@xuhy-PC /cygdrive/f/osgeo4w/osg/trunk/OpenSceneGraph
$ mak ...

ANDROID_NDK路径没有配置

该用户从未签到

发表于 2014-8-9 19:02:06 | 显示全部楼层
楼主解决了吗

该用户从未签到

发表于 2014-10-19 23:19:52 | 显示全部楼层
  1. make[2]: ANDROID_NDK-NOTFOUND/ndk-build: Command not found
复制代码

这个是ANDROID_NDK没有设置好。
您需要登录后才可以回帖 登录 | 注册

本版积分规则

OSG中国官方论坛-有您OSG在中国才更好

网站简介:osgChina是国内首个三维相关技术开源社区,旨在为国内更多的技术开发人员提供最前沿的技术资讯,为更多的三维从业者提供一个学习、交流的技术平台。

联系我们

  • 工作时间:09:00--18:00
  • 反馈邮箱:1315785073@qq.com
快速回复 返回顶部 返回列表