查看: 3078|回复: 8

Ubantu编译OSG出错,求指教!!

[复制链接]

该用户从未签到

发表于 2015-3-26 16:40:12 | 显示全部楼层 |阅读模式
cmake—cmake-2.8.10.2-Linux-i386
osg版本—OpenSceneGraph-3.0.1
osg数据—OpenSceneGraph-Data-3.0.0
第三方依赖库—linux-Ubuntu-x86-release
Ubantu版本:Ubuntu 12.04 LTS
用以下两种方法编译都出现错误,最终不成功,求指教!
第一种方法:
直接将cmake-gui打开,将openscenegraph根目录下的CMakeLists.txt拖进去,点击configure,出现以下错误(图片上传不了)
具体信息如下:
第一次configure出现的错误信息,并弹出的对话框显示“Error in configuration process,project files may be invalid”

.........
Looking for pthread_create
Looking for pthread_create - not found
Looking for pthread_create in pthreads
Looking for pthread_create in pthreads - not found
.....................
Could NOT find OpenGL (missing: OPENGL_gl_LIBRARY)

Looking for XOpenDisplay in /usr/lib/i386-linux-gnu/libX11.so;/usr/lib/i386-linux-gnu/libXext.so
Looking for XOpenDisplay in /usr/lib/i386-linux-gnu/libX11.so;/usr/lib/i386-linux-gnu/libXext.so - found
Looking for gethostbyname
Looking for gethostbyname - found
Looking for connect
Looking for connect - found
Looking for remove
Looking for remove - found
Looking for shmat
Looking for shmat - found
Found X11: /usr/lib/i386-linux-gnu/libX11.so

Could NOT find LibXml2 (missing: LIBXML2_LIBRARIES LIBXML2_INCLUDE_DIR)
Could NOT find CURL (missing: CURL_LIBRARY CURL_INCLUDE_DIR)

CMake Warning at /home/zgh/OSG/cmake-2.8.10.2-Linux-i386/share/cmake-2.8/Modules/FindITK.cmake:48 (find_package):
Could not find a package configuration file named "ITKConfig.cmake"
provided by package "ITK".
Add the installation prefix of "ITK" to CMAKE_PREFIX_PATH or set "ITK_DIR"
to a directory containing one of the above files. If "ITK" provides a
separate development package or SDK, be sure it has been installed.
Call Stack (most recent call first):
CMakeLists.txt:465 (FIND_PACKAGE)
Could NOT find OpenAL (missing: OPENAL_LIBRARY OPENAL_INCLUDE_DIR)
Could NOT find SDL (missing: SDL_LIBRARY SDL_INCLUDE_DIR)
Found PkgConfig: /usr/bin/pkg-config (found version "0.26")
checking for module 'cairo'
package 'cairo' not found
checking for module 'poppler-glib'
package 'poppler-glib' not found
checking for module 'librsvg-2.0'
package 'librsvg-2.0' not found
checking for module 'cairo'
package 'cairo' not found
checking for module 'gtk+-2.0'
package 'gtk+-2.0' not found
checking for module 'gtkglext-x11-1.0'
package 'gtkglext-x11-1.0' not found

Could NOT find Qt4 (missing: QT_QMAKE_EXECUTABLE QT_MOC_EXECUTABLE QT_RCC_EXECUTABLE QT_UIC_EXECUTABLE QT_INCLUDE_DIR QT_LIBRARY_DIR QT_QTCORE_LIBRARY)
Could NOT find Qt3 (missing: QT_QT_LIBRARY QT_INCLUDE_DIR QT_MOC_EXECUTABLE)
Could NOT find JPEG (missing: JPEG_LIBRARY JPEG_INCLUDE_DIR)
CMake Warning (dev) at /home/zgh/OSG/cmake-2.8.10.2-Linux-i386/share/cmake-2.8/Modules/FindPNG.cmake:34 (find_package):
File
..................................
Call Stack (most recent call first):
CMakeLists.txt:535 (FIND_PACKAGE)
This warning is for project developers. Use -Wno-dev to suppress it.
Could NOT find PNG (missing: PNG_LIBRARY PNG_PNG_INCLUDE_DIR)
Could NOT find TIFF (missing: TIFF_LIBRARY TIFF_INCLUDE_DIR)
Performing Test _OPENTHREADS_ATOMIC_USE_GCC_BUILTINS
Performing Test _OPENTHREADS_ATOMIC_USE_GCC_BUILTINS - Success
Performing Test _OPENTHREADS_ATOMIC_USE_MIPOSPRO_BUILTINS
Performing Test _OPENTHREADS_ATOMIC_USE_MIPOSPRO_BUILTINS - Failed
Performing Test _OPENTHREADS_ATOMIC_USE_SUN
Performing Test _OPENTHREADS_ATOMIC_USE_SUN - Failed
Performing Test _OPENTHREADS_ATOMIC_USE_WIN32_INTERLOCKED
Performing Test _OPENTHREADS_ATOMIC_USE_WIN32_INTERLOCKED - Failed
Performing Test _OPENTHREADS_ATOMIC_USE_BSD_ATOMIC
Performing Test _OPENTHREADS_ATOMIC_USE_BSD_ATOMIC - Failed
Looking for pthread_yield
Looking for pthread_yield - not found
Looking for sched_yield
Looking for sched_yield - found
Looking for pthread_setconcurrency
Looking for pthread_setconcurrency - not found
Looking for pthread_getconcurrency
Looking for pthread_getconcurrency - not found
Looking for pthread_setaffinity_np
Looking for pthread_setaffinity_np - not found
Performing Test HAVE_THREE_PARAM_SCHED_SETAFFINITY
Performing Test HAVE_THREE_PARAM_SCHED_SETAFFINITY - Success
checking for module 'xrandr'
package 'xrandr' not found
Looking for gethostbyname in nsl
Looking for gethostbyname in nsl - found
Looking for socket in socket
Looking for socket in socket - not found
The build system is configured to install libraries to /usr/local/lib
Your applications may not be able to find your installed libraries unless you:
set your LD_LIBRARY_PATH (user specific) or
update your ld.so configuration (system wide)
You have an ld.so.conf.d directory on your system, so if you wish to ensure that
applications find the installed osg libraries, system wide, you could install an
OpenSceneGraph specific ld.so configuration with:
sudo make install_ld_conf
CMake Error: The following variables are used in this project, but they are set to NOTFOUND.Please set them or make sure they are set and tested correctly in the CMake files:
OPENGL_INCLUDE_DIR (ADVANCED)
used as include directory in directory /home/zgh/OSG/OpenSceneGraph-3.0.1
used as include directory in directory /home/zgh/OSG/OpenSceneGraph-3.0.1
used as include directory in directory /home/zgh/OSG/OpenSceneGraph-3.0.1/src/OpenThreads/pthreads
used as include directory in directory /home/zgh/OSG/OpenSceneGraph-3.0.1/src/osg
used as include directory in directory /home/zgh/OSG/OpenSceneGraph-3.0.1/src/osgDB
used as include directory in directory /home/zgh/OSG/OpenSceneGraph-3.0.1/src/osgUtil
used as include directory in directory /home/zgh/OSG/OpenSceneGraph-3.0.1/src/osgGA
used as include directory in directory /home/zgh/OSG/OpenSceneGraph-3.0.1/src/osgText
used as include directory in directory /home/zgh/OSG/OpenSceneGraph-3.0.1/src/osgViewer
used as include directory in directory /home/zgh/OSG/OpenSceneGraph-3.0.1/src/osgAnimation
used as include directory in directory /home/zgh/OSG/OpenSceneGraph-3.0.1/src/osgFX
used as include directory in directory /home/zgh/OSG/OpenSceneGraph-3.0.1/src/osgManipulator
used as include directory in directory /home/zgh/OSG/OpenSceneGraph-3.0.1/src/osgParticle
used as include directory in directory /home/zgh/OSG/OpenSceneGraph-3.0.1/src/osgPresentation
used as include directory in directory /home/zgh/OSG/OpenSceneGraph-3.0.1/src/osgShadow
used as include directory in directory /home/zgh/OSG/OpenSceneGraph-3.0.1/src/osgSim
used as include directory in directory /home/zgh/OSG/OpenSceneGraph-3.0.1/src/osgTerrain
used as include directory in directory /home/zgh/OSG/OpenSceneGraph-3.0.1/src/osgWidget
used as include directory in directory /home/zgh/OSG/OpenSceneGraph-3.0.1/src/osgVolume
used as include directory in directory /home/zgh/OSG/OpenSceneGraph-3.0.1/src/osgWrappers/serializers/osg
used as include directory in directory /home/zgh/OSG/OpenSceneGraph-3.0.1/src/osgWrappers/serializers/osgAnimation
used as include directory in directory /home/zgh/OSG/OpenSceneGraph-3.0.1/src/osgWrappers/serializers/osgFX
used as include directory in directory /home/zgh/OSG/OpenSceneGraph-3.0.1/src/osgWrappers/serializers/osgManipulator
used as include directory in directory /home/zgh/OSG/OpenSceneGraph-3.0.1/src/osgWrappers/serializers/osgParticle
used as include directory in directory /home/zgh/OSG/OpenSceneGraph-3.0.1/src/osgWrappers/serializers/osgSim
used as include directory in directory /home/zgh/OSG/OpenSceneGraph-3.0.1/src/osgWrappers/serializers/osgShadow
used as include directory in directory /home/zgh/OSG/OpenSceneGraph-3.0.1/src/osgWrappers/serializers/osgTerrain
used as include directory in directory /home/zgh/OSG/OpenSceneGraph-3.0.1/src/osgWrappers/serializers/osgText
used as include directory in directory /home/zgh/OSG/OpenSceneGraph-3.0.1/src/osgWrappers/serializers/osgVolume
used as include directory in directory /home/zgh/OSG/OpenSceneGraph-3.0.1/src/osgWrappers/deprecated-dotosg/osg
used as include directory in directory /home/zgh/OSG/OpenSceneGraph-3.0.1/src/osgWrappers/deprecated-dotosg/osgParticle
used as include directory in directory /home/zgh/OSG/OpenSceneGraph-3.0.1/src/osgWrappers/deprecated-dotosg/osgAnimation
used as include directory in directory /home/zgh/OSG/OpenSceneGraph-3.0.1/src/osgWrappers/deprecated-dotosg/osgFX
used as include directory in directory /home/zgh/OSG/OpenSceneGraph-3.0.1/src/osgWrappers/deprecated-dotosg/osgSim
used as include directory in directory /home/zgh/OSG/OpenSceneGraph-3.0.1/src/osgWrappers/deprecated-dotosg/osgText
used as include directory in directory /home/zgh/OSG/OpenSceneGraph-3.0.1/src/osgWrappers/deprecated-dotosg/osgViewer
used as include directory in directory /home/zgh/OSG/OpenSceneGraph-3.0.1/src/osgWrappers/deprecated-dotosg/osgShadow
used as include directory in directory /home/zgh/OSG/OpenSceneGraph-3.0.1/src/osgWrappers/deprecated-dotosg/osgTerrain
used as include directory in directory /home/zgh/OSG/OpenSceneGraph-3.0.1/src/osgWrappers/deprecated-dotosg/osgVolume
used as include directory in directory /home/zgh/OSG/OpenSceneGraph-3.0.1/src/osgWrappers/deprecated-dotosg/osgWidget
used as include directory in directory /home/zgh/OSG/OpenSceneGraph-3.0.1/src/osgPlugins/osga
used as include directory in directory /home/zgh/OSG/OpenSceneGraph-3.0.1/src/osgPlugins/rot
used as include directory in directory /home/zgh/OSG/OpenSceneGraph-3.0.1/src/osgPlugins/scale
used as include directory in directory /home/zgh/OSG/OpenSceneGraph-3.0.1/src/osgPlugins/trans
used as include directory in directory /home/zgh/OSG/OpenSceneGraph-3.0.1/src/osgPlugins/normals
used as include directory in directory /home/zgh/OSG/OpenSceneGraph-3.0.1/src/osgPlugins/revisions
used as include directory in directory /home/zgh/OSG/OpenSceneGraph-3.0.1/src/osgPlugins/view
used as include directory in directory /home/zgh/OSG/OpenSceneGraph-3.0.1/src/osgPlugins/shadow
used as include directory in directory /home/zgh/OSG/OpenSceneGraph-3.0.1/src/osgPlugins/terrain
used as include directory in directory /home/zgh/OSG/OpenSceneGraph-3.0.1/src/osgPlugins/osg
used as include directory in directory /home/zgh/OSG/OpenSceneGraph-3.0.1/src/osgPlugins/ive
used as include directory in directory /home/zgh/OSG/OpenSceneGraph-3.0.1/src/osgPlugins/cfg
used as include directory in directory /home/zgh/OSG/OpenSceneGraph-3.0.1/src/osgPlugins/glsl
used as include directory in directory /home/zgh/OSG/OpenSceneGraph-3.0.1/src/osgPlugins/rgb
used as include directory in directory /home/zgh/OSG/OpenSceneGraph-3.0.1/src/osgPlugins/bmp
used as include directory in directory /home/zgh/OSG/OpenSceneGraph-3.0.1/src/osgPlugins/pnm
used as include directory in directory /home/zgh/OSG/OpenSceneGraph-3.0.1/src/osgPlugins/dds
used as include directory in directory /home/zgh/OSG/OpenSceneGraph-3.0.1/src/osgPlugins/tga
used as include directory in directory /home/zgh/OSG/OpenSceneGraph-3.0.1/src/osgPlugins/hdr
used as include directory in directory /home/zgh/OSG/OpenSceneGraph-3.0.1/src/osgPlugins/dot
used as include directory in directory /home/zgh/OSG/OpenSceneGraph-3.0.1/src/osgPlugins/vtf
used as include directory in directory /home/zgh/OSG/OpenSceneGraph-3.0.1/src/osgPlugins/3dc
used as include directory in directory /home/zgh/OSG/OpenSceneGraph-3.0.1/src/osgPlugins/p3d
used as include directory in directory /home/zgh/OSG/OpenSceneGraph-3.0.1/src/osgPlugins/lwo
used as include directory in directory /home/zgh/OSG/OpenSceneGraph-3.0.1/src/osgPlugins/dw
used as include directory in directory /home/zgh/OSG/OpenSceneGraph-3.0.1/src/osgPlugins/bvh
used as include directory in directory /home/zgh/OSG/OpenSceneGraph-3.0.1/src/osgPlugins/x
used as include directory in directory /home/zgh/OSG/OpenSceneGraph-3.0.1/src/osgPlugins/dxf
used as include directory in directory /home/zgh/OSG/OpenSceneGraph-3.0.1/src/osgPlugins/OpenFlight
used as include directory in directory /home/zgh/OSG/OpenSceneGraph-3.0.1/src/osgPlugins/geo
used as include directory in directory /home/zgh/OSG/OpenSceneGraph-3.0.1/src/osgPlugins/obj
used as include directory in directory /home/zgh/OSG/OpenSceneGraph-3.0.1/src/osgPlugins/pic
used as include directory in directory /home/zgh/OSG/OpenSceneGraph-3.0.1/src/osgPlugins/stl
used as include directory in directory /home/zgh/OSG/OpenSceneGraph-3.0.1/src/osgPlugins/3ds
used as include directory in directory /home/zgh/OSG/OpenSceneGraph-3.0.1/src/osgPlugins/ac
used as include directory in directory /home/zgh/OSG/OpenSceneGraph-3.0.1/src/osgPlugins/pov
used as include directory in directory /home/zgh/OSG/OpenSceneGraph-3.0.1/src/osgPlugins/logo
used as include directory in directory /home/zgh/OSG/OpenSceneGraph-3.0.1/src/osgPlugins/lws
used as include directory in directory /home/zgh/OSG/OpenSceneGraph-3.0.1/src/osgPlugins/md2
used as include directory in directory /home/zgh/OSG/OpenSceneGraph-3.0.1/src/osgPlugins/osgtgz
used as include directory in directory /home/zgh/OSG/OpenSceneGraph-3.0.1/src/osgPlugins/tgz
used as include directory in directory /home/zgh/OSG/OpenSceneGraph-3.0.1/src/osgPlugins/shp
used as include directory in directory /home/zgh/OSG/OpenSceneGraph-3.0.1/src/osgPlugins/txf
used as include directory in directory /home/zgh/OSG/OpenSceneGraph-3.0.1/src/osgPlugins/bsp
used as include directory in directory /home/zgh/OSG/OpenSceneGraph-3.0.1/src/osgPlugins/mdl
used as include directory in directory /home/zgh/OSG/OpenSceneGraph-3.0.1/src/osgPlugins/ply
used as include directory in directory /home/zgh/OSG/OpenSceneGraph-3.0.1/src/osgPlugins/txp
used as include directory in directory /home/zgh/OSG/OpenSceneGraph-3.0.1/src/osgPlugins/pvr
used as include directory in directory /home/zgh/OSG/OpenSceneGraph-3.0.1/applications/osgviewer
used as include directory in directory /home/zgh/OSG/OpenSceneGraph-3.0.1/applications/osgarchive
used as include directory in directory /home/zgh/OSG/OpenSceneGraph-3.0.1/applications/osgconv
used as include directory in directory /home/zgh/OSG/OpenSceneGraph-3.0.1/applications/osgfilecache
used as include directory in directory /home/zgh/OSG/OpenSceneGraph-3.0.1/applications/osgversion
used as include directory in directory /home/zgh/OSG/OpenSceneGraph-3.0.1/applications/present3D
OPENGL_gl_LIBRARY (ADVANCED)
linked by target "osg" in directory /home/zgh/OSG/OpenSceneGraph-3.0.1/src/osg
linked by target "osgDB" in directory /home/zgh/OSG/OpenSceneGraph-3.0.1/src/osgDB
linked by target "osgUtil" in directory /home/zgh/OSG/OpenSceneGraph-3.0.1/src/osgUtil
linked by target "osgGA" in directory /home/zgh/OSG/OpenSceneGraph-3.0.1/src/osgGA
linked by target "osgText" in directory /home/zgh/OSG/OpenSceneGraph-3.0.1/src/osgText
linked by target "osgViewer" in directory /home/zgh/OSG/OpenSceneGraph-3.0.1/src/osgViewer
linked by target "osgAnimation" in directory /home/zgh/OSG/OpenSceneGraph-3.0.1/src/osgAnimation
linked by target "osgFX" in directory /home/zgh/OSG/OpenSceneGraph-3.0.1/src/osgFX
linked by target "osgManipulator" in directory /home/zgh/OSG/OpenSceneGraph-3.0.1/src/osgManipulator
linked by target "osgParticle" in directory /home/zgh/OSG/OpenSceneGraph-3.0.1/src/osgParticle
linked by target "osgPresentation" in directory /home/zgh/OSG/OpenSceneGraph-3.0.1/src/osgPresentation
linked by target "osgShadow" in directory /home/zgh/OSG/OpenSceneGraph-3.0.1/src/osgShadow
linked by target "osgSim" in directory /home/zgh/OSG/OpenSceneGraph-3.0.1/src/osgSim
linked by target "osgTerrain" in directory /home/zgh/OSG/OpenSceneGraph-3.0.1/src/osgTerrain
linked by target "osgWidget" in directory /home/zgh/OSG/OpenSceneGraph-3.0.1/src/osgWidget
linked by target "osgVolume" in directory /home/zgh/OSG/OpenSceneGraph-3.0.1/src/osgVolume
Configuring incomplete, errors occurred!


第二种方法:
用sudo apt-get 方法安装cmake 和第三方依赖库,不成功,提示错误如下
root@zgh-vm:/home/zdd/OSG# sudo apt-get build-dep linux-Ubuntu-x86-release/
正在读取软件包列表... 完成
正在分析软件包的依赖关系树      
正在读取状态信息... 完成      
E: 您必须在您的 sources.list 写入一些“软件源”的 URI

请教各位,有谁遇到过这样的问题,现在真是不知道怎么办!急求!!

该用户从未签到

 楼主| 发表于 2015-3-27 09:41:18 | 显示全部楼层
版主,请解答下啊,谢谢

该用户从未签到

发表于 2015-3-31 17:05:46 | 显示全部楼层
去下载一个cmake

该用户从未签到

发表于 2015-3-31 17:07:38 | 显示全部楼层
在cmake-gui里面要configure2次

该用户从未签到

 楼主| 发表于 2015-4-2 09:29:51 | 显示全部楼层
li1989 发表于 2015-3-31 17:07
在cmake-gui里面要configure2次

我知道要configure两次,但第一次configure就出错了,不知道是什么原因,朋友你是怎么编译的呢?望指教

该用户从未签到

 楼主| 发表于 2015-4-2 09:30:30 | 显示全部楼层

谢谢,我下个cmake试试先

该用户从未签到

发表于 2015-4-2 09:53:31 | 显示全部楼层
790800036我也是新手能帮你就帮你qq

该用户从未签到

发表于 2015-5-4 15:53:27 | 显示全部楼层
OPENGL_gl_LIBRARY (ADVANCED)
OPENGL_INCLUDE_DIR (ADVANCED)
这两个值必须在cmake里面指定,我也是遇到这个问题,刚刚解决。先apt-get下载一个cmake-gui。然后去osg官网找到osg 的依赖库,下载ubuntu的,里面会有一个GL的库,把这两个值指定到GL的include和lib里。
最后,好像自己也得安装一下opengl的开发环境,否则会说GL/gl.h不存在。
需要更新自己的源列表之后,才能apt-get到,参考下面的链接
http://wiki.ubuntu.org.cn/%E6%BA ... 9.E7.89.88.E6.9C.AC

该用户从未签到

 楼主| 发表于 2015-5-7 11:35:12 | 显示全部楼层
nononono 发表于 2015-5-4 15:53
OPENGL_gl_LIBRARY (ADVANCED)
OPENGL_INCLUDE_DIR (ADVANCED)
这两个值必须在cmake里面指定,我也是遇到 ...

谢谢,先试试,有问题再请教
您需要登录后才可以回帖 登录 | 注册

本版积分规则

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

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

联系我们

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