查看: 1890|回复: 4

ubuntu下使用Android NDK编译OSG-3.2.0的问题

[复制链接]

该用户从未签到

发表于 2014-10-24 21:30:03 | 显示全部楼层 |阅读模式
我的步骤是:一、下载OSG-3.2.0和3rdpartyAndroid.zip;二、解压3rdpartyAndroid.zip到OSG-3.2.0的源目录;三、新建目录build,进入build,cmake ......,make.但是在编译的过程中出现gdal_priv.h找不到的错误,和一些变量没有声明,都是与插件gdal有关的。我查一下,3rdparty有相关文件,不知道是什么原因,有没有出现相似的问题。

该用户从未签到

 楼主| 发表于 2014-10-25 08:44:18 | 显示全部楼层
/home/bruce/Android/OpenSceneGraph-3.2.1/src/osgPlugins/gdal/ReaderWriterGDAL.cpp:714: error: 'GDALRasterBand' was not declared in this scope
/home/bruce/Android/OpenSceneGraph-3.2.1/src/osgPlugins/gdal/ReaderWriterGDAL.cpp:714: error: 'bandGray' was not declared in this scope
/home/bruce/Android/OpenSceneGraph-3.2.1/src/osgPlugins/gdal/ReaderWriterGDAL.cpp:715: error: 'bandRed' was not declared in this scope
/home/bruce/Android/OpenSceneGraph-3.2.1/src/osgPlugins/gdal/ReaderWriterGDAL.cpp:716: error: 'bandGreen' was not declared in this scope
/home/bruce/Android/OpenSceneGraph-3.2.1/src/osgPlugins/gdal/ReaderWriterGDAL.cpp:717: error: 'bandBlue' was not declared in this scope
/home/bruce/Android/OpenSceneGraph-3.2.1/src/osgPlugins/gdal/ReaderWriterGDAL.cpp:718: error: 'bandAlpha' was not declared in this scope
/home/bruce/Android/OpenSceneGraph-3.2.1/src/osgPlugins/gdal/ReaderWriterGDAL.cpp:723: error: 'band' was not declared in this scope
/home/bruce/Android/OpenSceneGraph-3.2.1/src/osgPlugins/gdal/ReaderWriterGDAL.cpp:723: error: base operand of '->' is not a pointer
/home/bruce/Android/OpenSceneGraph-3.2.1/src/osgPlugins/gdal/ReaderWriterGDAL.cpp:729: error: 'GDALGetDataTypeName' was not declared in this scope
/home/bruce/Android/OpenSceneGraph-3.2.1/src/osgPlugins/gdal/ReaderWriterGDAL.cpp:730: error: 'GDALGetColorInterpretationName' was not declared in this scope
/home/bruce/Android/OpenSceneGraph-3.2.1/src/osgPlugins/gdal/ReaderWriterGDAL.cpp:742: error: 'GCI_GrayIndex' was not declared in this scope
/home/bruce/Android/OpenSceneGraph-3.2.1/src/osgPlugins/gdal/ReaderWriterGDAL.cpp:743: error: 'GCI_RedBand' was not declared in this scope
/home/bruce/Android/OpenSceneGraph-3.2.1/src/osgPlugins/gdal/ReaderWriterGDAL.cpp:744: error: 'GCI_GreenBand' was not declared in this scope
/home/bruce/Android/OpenSceneGraph-3.2.1/src/osgPlugins/gdal/ReaderWriterGDAL.cpp:745: error: 'GCI_BlueBand' was not declared in this scope
/home/bruce/Android/OpenSceneGraph-3.2.1/src/osgPlugins/gdal/ReaderWriterGDAL.cpp:746: error: 'GCI_AlphaBand' was not declared in this scope
/home/bruce/Android/OpenSceneGraph-3.2.1/src/osgPlugins/gdal/ReaderWriterGDAL.cpp:752: error: 'bandSelected' was not declared in this scope
/home/bruce/Android/OpenSceneGraph-3.2.1/src/osgPlugins/gdal/ReaderWriterGDAL.cpp:764: error: 'GF_Read' was not declared in this scope
/home/bruce/Android/OpenSceneGraph-3.2.1/src/osgPlugins/gdal/ReaderWriterGDAL.cpp:764: error: 'GDT_Float32' was not declared in this scope
/home/bruce/Android/OpenSceneGraph-3.2.1/src/osgPlugins/gdal/ReaderWriterGDAL.cpp: In member function 'void ReaderWriterGDAL::initGDAL() const':
/home/bruce/Android/OpenSceneGraph-3.2.1/src/osgPlugins/gdal/ReaderWriterGDAL.cpp:798: error: 'GDALAllRegister' was not declared in this scope
In file included from /home/bruce/Android/OpenSceneGraph-3.2.1/src/osgPlugins/gdal/DataSetLayer.cpp:14:
/home/bruce/Android/OpenSceneGraph-3.2.1/src/osgPlugins/gdal/DataSetLayer.h:57: error: ISO C++ forbids declaration of 'GDALDataset' with no type
/home/bruce/Android/OpenSceneGraph-3.2.1/src/osgPlugins/gdal/DataSetLayer.h:57: error: expected ';' before '*' token
In file included from /home/bruce/Android/OpenSceneGraph-3.2.1/src/osgPlugins/gdal/DataSetLayer.cpp:14:
/home/bruce/Android/OpenSceneGraph-3.2.1/src/osgPlugins/gdal/DataSetLayer.h: In member function 'virtual bool GDALPlugin:ataSetLayer::isOpen() const':
/home/bruce/Android/OpenSceneGraph-3.2.1/src/osgPlugins/gdal/DataSetLayer.h:37: error: '_dataset' was not declared in this scope
/home/bruce/Android/OpenSceneGraph-3.2.1/src/osgPlugins/gdal/DataSetLayer.cpp: In constructor 'GDALPlugin::DataSetLayer::DataSetLayer()':
/home/bruce/Android/OpenSceneGraph-3.2.1/src/osgPlugins/gdal/DataSetLayer.cpp:28: error: class 'GDALPlugin::DataSetLayer' does not have any field named '_dataset'
/home/bruce/Android/OpenSceneGraph-3.2.1/src/osgPlugins/gdal/DataSetLayer.cpp: In constructor 'GDALPlugin::DataS

该用户从未签到

 楼主| 发表于 2014-10-26 14:52:34 | 显示全部楼层
问题已解决,是因为自动生成的Android.mk检测依赖文件不完全,手动修改Android.mk就可以啦!只有GDAL和ORG两个插件,修改后好啦!希望对有同样问题的朋友有用。

该用户从未签到

发表于 2014-11-16 22:46:58 | 显示全部楼层
楼主的3.2.0能用吗?

该用户从未签到

发表于 2014-11-16 22:47:15 | 显示全部楼层
楼主的3.2.0在gles2能用吗?
您需要登录后才可以回帖 登录 | 注册

本版积分规则

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

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

联系我们

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