查看: 1404|回复: 2

OSG在Ubuntu上编译Android版本有误~

[复制链接]

该用户从未签到

发表于 2014-11-11 11:17:08 | 显示全部楼层 |阅读模式
OSG在Ubuntu上编译Android版本有误~

Ubuntu 14.04 64位

Andorid SDK / NDK 分别位于:
/home/xx/Soft/Android/sdk
/home/xx/Soft/Android/android-ndk-r10c

添加环境变量 :
xx@ubuntu:sudo vim ~/.bashrc
在末尾添加了如下两项:
export ANDROID_NDK=$HOME/Soft/Android/android-ndk-r10c
export ANDROID_SDK=$HOME/Soft/Android/sdk


下载的源码位于:
/home/xx/Soft/OSG/OpenSceneGraph-3.2.1-rc3


并在其中创建两个子目录
/home/xx/Soft/OSG/OpenSceneGraph-3.2.1-rc3/build
/home/xx/Soft/OSG/OpenSceneGraph-3.2.1-rc3/osginstall

以及
Third Party Library -linux-Ubuntu-x64-release.7z
解压到
/home/xx/Soft/OSG/OpenSceneGraph-3.2.1-rc3/3rdparty


系统已将OSG安装好了,可以在终端直接运行 osgviewer  osgversion

如:
xx@ubuntu:~/Soft/OSG/OpenSceneGraph-3.2.1-rc3$ osgversion
OpenSceneGraph Library 3.2.1

上述为系统环境与路径

--------------------------------------------------------------------------------------------
接下来编译:
参照:
http://blog.163.com/xjruan@yeah/ ... 752012111324153667/
http://www.openscenegraph.org/in ... h-for-android-3-0-2
http://blog.csdn.net/xuhaiyan8825/article/details/7867728
--------------------------------------------------------------------------------------------

--------------------------------------------------------------------------------------------
首先:
进入build目录
xx@ubuntu:~$ cd /home/xx/Soft/OSG/OpenSceneGraph-3.2.1-rc3/build
xx@ubuntu:~/Soft/OSG/OpenSceneGraph-3.2.1-rc3/build$ pwd
/home/xx/Soft/OSG/OpenSceneGraph-3.2.1-rc3/build

在此目录下执行:
xx@ubuntu:~/Soft/OSG/OpenSceneGraph-3.2.1-rc3/build$ cmake .. -DOSG_BUILD_PLATFORM_ANDROID=ON -DDYNAMIC_OPENTHREADS=OFF -DDYNAMIC_OPENSCENEGRAPH=OFF -DOSG_GL2_AVAILABLE=OFF -DOSG_GL3_AVAILABLE=OFF -DOSG_GLES1_AVAILABLE=OFF -DOSG_GLES2_AVAILABLE=ON -DOSG_GL_LIBRARY_STATIC=OFF -DOSG_GL_DISPLAYLISTS_AVAILABLE=OFF -DOSG_GL_MATRICES_AVAILABLE=OFF  -DOSG_GL_VERTEX_FUNCS_AVAILABLE=OFF  -DOSG_GL_VERTEX_ARRAY_FUNCS_AVAILABLE=OFF  -DOSG_GL_FIXED_FUNCTION_AVAILABLE=OFF -DANDROID_ABI="armeabi armeabi-v7a" -DANDROID_PLATFORM=8  -DANDROID_STL="gnustl_static"  -DJ=4 -DCMAKE_INSTALL_PREFIX=/home/xx/Soft/OSG/OpenSceneGraph-3.2.1-rc3/osginstall

系统反馈:
Warning Android Build is in release mode
-- Android NDK found in: /home/xx/Soft/Android/android-ndk-r10c
-- Jpeg missing
-- PNG missing
-- GIF missing
-- TIF missing
-- Curl missing
-- FREETYPE missing
-- GDAL missing
-- ##############Creating Android Makefile#################
-- name: OpenThreads
-- ##############Creating Android Makefile#################
-- name: osg
-- ##############Creating Android Makefile#################
-- name: osgDB
-- ##############Creating Android Makefile#################
-- name: osgUtil
-- ##############Creating Android Makefile#################
-- name: osgGA
-- ##############Creating Android Makefile#################
-- name: osgText
-- checking for module 'xrandr'
--   package 'xrandr' not found
-- ##############Creating Android Makefile#################
-- name: osgViewer
-- ##############Creating Android Makefile#################
-- name: osgAnimation
-- ##############Creating Android Makefile#################
-- name: osgFX
-- ##############Creating Android Makefile#################
-- name: osgManipulator
-- ##############Creating Android Makefile#################
-- name: osgParticle
-- ##############Creating Android Makefile#################
-- name: osgPresentation
-- ##############Creating Android Makefile#################
-- name: osgShadow
-- ##############Creating Android Makefile#################
-- name: osgSim
-- ##############Creating Android Makefile#################
-- name: osgTerrain
-- ##############Creating Android Makefile#################
-- name: osgWidget
-- ##############Creating Android Makefile#################
-- name: osgVolume
-- ##############Creating Android Makefile#################
-- name: osgdb_serializers_osg
-- ##############Creating Android Makefile#################
-- name: osgdb_serializers_osganimation
-- ##############Creating Android Makefile#################
-- name: osgdb_serializers_osgfx
-- ##############Creating Android Makefile#################
-- name: osgdb_serializers_osgmanipulator
-- ##############Creating Android Makefile#################
-- name: osgdb_serializers_osgparticle
-- ##############Creating Android Makefile#################
-- name: osgdb_serializers_osgsim
-- ##############Creating Android Makefile#################
-- name: osgdb_serializers_osgshadow
-- ##############Creating Android Makefile#################
-- name: osgdb_serializers_osgga
-- ##############Creating Android Makefile#################
-- name: osgdb_serializers_osgterrain
-- ##############Creating Android Makefile#################
-- name: osgdb_serializers_osgtext
-- ##############Creating Android Makefile#################
-- name: osgdb_serializers_osgvolume
-- ##############Creating Android Makefile#################
-- name: osgdb_serializers_osgviewer
-- ##############Creating Android Makefile#################
-- name: osgdb_deprecated_osg
-- ##############Creating Android Makefile#################
-- name: osgdb_deprecated_osgparticle
-- ##############Creating Android Makefile#################
-- name: osgdb_deprecated_osganimation
-- ##############Creating Android Makefile#################
-- name: osgdb_deprecated_osgfx
-- ##############Creating Android Makefile#################
-- name: osgdb_deprecated_osgsim
-- ##############Creating Android Makefile#################
-- name: osgdb_deprecated_osgtext
-- ##############Creating Android Makefile#################
-- name: osgdb_deprecated_osgviewer
-- ##############Creating Android Makefile#################
-- name: osgdb_deprecated_osgshadow
-- ##############Creating Android Makefile#################
-- name: osgdb_deprecated_osgterrain
-- ##############Creating Android Makefile#################
-- name: osgdb_deprecated_osgvolume
-- ##############Creating Android Makefile#################
-- name: osgdb_deprecated_osgwidget
-- ##############Creating Android Makefile#################
-- name: osgdb_osga
-- ##############Creating Android Makefile#################
-- name: osgdb_rot
-- ##############Creating Android Makefile#################
-- name: osgdb_scale
-- ##############Creating Android Makefile#################
-- name: osgdb_trans
-- ##############Creating Android Makefile#################
-- name: osgdb_normals
-- ##############Creating Android Makefile#################
-- name: osgdb_revisions
-- ##############Creating Android Makefile#################
-- name: osgdb_osgviewer
-- ##############Creating Android Makefile#################
-- name: osgdb_osgshadow
-- ##############Creating Android Makefile#################
-- name: osgdb_osgterrain
-- ##############Creating Android Makefile#################
-- name: osgdb_osg
-- ##############Creating Android Makefile#################
-- name: osgdb_ive
-- ##############Creating Android Makefile#################
-- name: osgdb_cfg
-- ##############Creating Android Makefile#################
-- name: osgdb_glsl
-- ##############Creating Android Makefile#################
-- name: osgdb_rgb
-- ##############Creating Android Makefile#################
-- name: osgdb_bmp
-- ##############Creating Android Makefile#################
-- name: osgdb_pnm
-- ##############Creating Android Makefile#################
-- name: osgdb_dds
-- ##############Creating Android Makefile#################
-- name: osgdb_tga
-- ##############Creating Android Makefile#################
-- name: osgdb_hdr
-- ##############Creating Android Makefile#################
-- name: osgdb_dot
-- ##############Creating Android Makefile#################
-- name: osgdb_vtf
-- ##############Creating Android Makefile#################
-- name: osgdb_ktx
-- ##############Creating Android Makefile#################
-- name: osgdb_3dc
-- ##############Creating Android Makefile#################
-- name: osgdb_p3d
-- ##############Creating Android Makefile#################
-- name: osgdb_dw
-- ##############Creating Android Makefile#################
-- name: osgdb_bvh
-- ##############Creating Android Makefile#################
-- name: osgdb_x
-- ##############Creating Android Makefile#################
-- name: osgdb_dxf
-- ##############Creating Android Makefile#################
-- name: osgdb_openflight
-- ##############Creating Android Makefile#################
-- name: osgdb_obj
-- ##############Creating Android Makefile#################
-- name: osgdb_pic
-- ##############Creating Android Makefile#################
-- name: osgdb_stl
-- ##############Creating Android Makefile#################
-- name: osgdb_ac
-- ##############Creating Android Makefile#################
-- name: osgdb_pov
-- ##############Creating Android Makefile#################
-- name: osgdb_logo
-- ##############Creating Android Makefile#################
-- name: osgdb_lws
-- ##############Creating Android Makefile#################
-- name: osgdb_md2
-- ##############Creating Android Makefile#################
-- name: osgdb_osgtgz
-- ##############Creating Android Makefile#################
-- name: osgdb_tgz
-- ##############Creating Android Makefile#################
-- name: osgdb_shp
-- ##############Creating Android Makefile#################
-- name: osgdb_txf
-- ##############Creating Android Makefile#################
-- name: osgdb_bsp
-- ##############Creating Android Makefile#################
-- name: osgdb_mdl
-- ##############Creating Android Makefile#################
-- name: osgdb_pvr
-- ##############Creating Android Makefile#################
-- name: osgdb_osc
-- ##############Creating Android Makefile#################
-- name: osgdb_trk
-- Creating Android Makefile Master files
-- Configuring done
-- Generating done
-- Build files have been written to: /home/xx/Soft/OSG/OpenSceneGraph-3.2.1-rc3
xx@ubuntu:~/Soft/OSG/OpenSceneGraph-3.2.1-rc3/build$


再行行
xx@ubuntu:~/Soft/OSG/OpenSceneGraph-3.2.1-rc3/build$ make
显示:
make: *** No targets specified and no makefile found.  Stop.

查看build目录,没有文件,不知道是不是这样:
xx@ubuntu:~/Soft/OSG/OpenSceneGraph-3.2.1-rc3/build$ ls -al
total 8
drwxrwxr-x  2 xx xx 4096 Nov 11 10:34 .
drwxr-xr-x 16 xx xx 4096 Nov 11 11:13 ..

找不到出错的地方了





原谅我对这些机制都不懂吧~~~

该用户从未签到

 楼主| 发表于 2014-11-11 11:21:44 | 显示全部楼层
看到Makefile 位于
/home/xx/Soft/OSG/OpenSceneGraph-3.2.1-rc3/Makefile
好吧,我切换到这个目录,再make吧

xx@ubuntu:~/Soft/OSG/OpenSceneGraph-3.2.1-rc3$ make
[100%] Generating Android-OpenSceneGraph
HOST_OS=linux
HOST_ARCH=x86_64
HOST_TAG=linux-x86_64
GNUMAKE=/home/xx/Soft/Android/android-ndk-r10c/prebuilt/linux-x86_64/bin/make (NDK prebuilt)

[100%] Built target ndk
xx@ubuntu:~/Soft/OSG/OpenSceneGraph-3.2.1-rc3$

显示成功


执行安装:
xx@ubuntu:~/Soft/OSG/OpenSceneGraph-3.2.1-rc3$ make install

最后显示失败:
-- Up-to-date: /home/xx/Soft/OSG/OpenSceneGraph-3.2.1-rc3/osginstall/include//osgFX/Registry
-- Up-to-date: /home/xx/Soft/OSG/OpenSceneGraph-3.2.1-rc3/osginstall/include//osgFX/BumpMapping
-- Up-to-date: /home/xx/Soft/OSG/OpenSceneGraph-3.2.1-rc3/osginstall/include//osgFX/Version
-- Up-to-date: /home/xx/Soft/OSG/OpenSceneGraph-3.2.1-rc3/osginstall/include//osgFX/Effect
-- Up-to-date: /home/xx/Soft/OSG/OpenSceneGraph-3.2.1-rc3/osginstall/include//osgFX/Cartoon
-- Up-to-date: /home/xx/Soft/OSG/OpenSceneGraph-3.2.1-rc3/osginstall/include//osgFX/SpecularHighlights
-- Up-to-date: /home/xx/Soft/OSG/OpenSceneGraph-3.2.1-rc3/osginstall/include//osgFX/Export
-- Installing: /home/xx/Soft/OSG/OpenSceneGraph-3.2.1-rc3/osginstall/include//osgShadow
-- Up-to-date: /home/xx/Soft/OSG/OpenSceneGraph-3.2.1-rc3/osginstall/include//osgShadow/SoftShadowMap
-- Up-to-date: /home/xx/Soft/OSG/OpenSceneGraph-3.2.1-rc3/osginstall/include//osgShadow/LightSpacePerspectiveShadowMap
-- Up-to-date: /home/xx/Soft/OSG/OpenSceneGraph-3.2.1-rc3/osginstall/include//osgShadow/ViewDependentShadowMap
-- Up-to-date: /home/xx/Soft/OSG/OpenSceneGraph-3.2.1-rc3/osginstall/include//osgShadow/ConvexPolyhedron
-- Up-to-date: /home/xx/Soft/OSG/OpenSceneGraph-3.2.1-rc3/osginstall/include//osgShadow/ShadowVolume
-- Up-to-date: /home/xx/Soft/OSG/OpenSceneGraph-3.2.1-rc3/osginstall/include//osgShadow/ProjectionShadowMap
-- Up-to-date: /home/xx/Soft/OSG/OpenSceneGraph-3.2.1-rc3/osginstall/include//osgShadow/OccluderGeometry
-- Up-to-date: /home/xx/Soft/OSG/OpenSceneGraph-3.2.1-rc3/osginstall/include//osgShadow/DebugShadowMap
-- Up-to-date: /home/xx/Soft/OSG/OpenSceneGraph-3.2.1-rc3/osginstall/include//osgShadow/ParallelSplitShadowMap
-- Up-to-date: /home/xx/Soft/OSG/OpenSceneGraph-3.2.1-rc3/osginstall/include//osgShadow/ShadowSettings
-- Up-to-date: /home/xx/Soft/OSG/OpenSceneGraph-3.2.1-rc3/osginstall/include//osgShadow/MinimalCullBoundsShadowMap
-- Up-to-date: /home/xx/Soft/OSG/OpenSceneGraph-3.2.1-rc3/osginstall/include//osgShadow/StandardShadowMap
-- Up-to-date: /home/xx/Soft/OSG/OpenSceneGraph-3.2.1-rc3/osginstall/include//osgShadow/ShadowMap
-- Up-to-date: /home/xx/Soft/OSG/OpenSceneGraph-3.2.1-rc3/osginstall/include//osgShadow/MinimalShadowMap
-- Up-to-date: /home/xx/Soft/OSG/OpenSceneGraph-3.2.1-rc3/osginstall/include//osgShadow/Version
-- Up-to-date: /home/xx/Soft/OSG/OpenSceneGraph-3.2.1-rc3/osginstall/include//osgShadow/ViewDependentShadowTechnique
-- Up-to-date: /home/xx/Soft/OSG/OpenSceneGraph-3.2.1-rc3/osginstall/include//osgShadow/ShadowedScene
-- Up-to-date: /home/xx/Soft/OSG/OpenSceneGraph-3.2.1-rc3/osginstall/include//osgShadow/ShadowTechnique
-- Up-to-date: /home/xx/Soft/OSG/OpenSceneGraph-3.2.1-rc3/osginstall/include//osgShadow/ShadowTexture
-- Up-to-date: /home/xx/Soft/OSG/OpenSceneGraph-3.2.1-rc3/osginstall/include//osgShadow/Export
-- Up-to-date: /home/xx/Soft/OSG/OpenSceneGraph-3.2.1-rc3/osginstall/include//osgShadow/MinimalDrawBoundsShadowMap
CMake Error at cmake_install.cmake:44 (FILE):
  file INSTALL cannot find "/home/xx/Soft/OSG/OpenSceneGraph-3.2.1-rc3/obj".

make: *** [install] Error 1

该用户从未签到

 楼主| 发表于 2014-11-11 11:35:39 | 显示全部楼层
/home/xx/Soft/OSG/OpenSceneGraph-3.2.1-rc3/osginstall/include 有内容
/home/xx/Soft/OSG/OpenSceneGraph-3.2.1-rc3/osginstall/obj   为空
您需要登录后才可以回帖 登录 | 注册

本版积分规则

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

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

联系我们

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