查看: 3398|回复: 8

为什么在svn下载最新的vpb和osg,vpb编译不过呢?

[复制链接]

该用户从未签到

发表于 2011-7-27 20:26:20 | 显示全部楼层 |阅读模式
本帖最后由 xiaoming_li834 于 2011-7-27 20:30 编辑

在svn上下载了最新的osg和vpb代码,然后都编译trunk下面的最新代码,osg编译是没问题的。然后vpb编译出现了很奇怪的问题。编译环境是vs2008
错误如下,请高手帮分析下,难道是osg和vpb版本不匹配?

2>D:\OSG\osg\OpenSceneGraph\trunk\include\osg/State(2489) : error C2784: 'bool std:perator <(const std::deque<_Ty,_Alloc> &,const std::deque<_Ty,_Alloc> &)' : could not deduce template argument for 'const std::deque<_Ty,_Alloc> &' from 'const std::string'
2>        D:\Program Files\Microsoft Visual Studio 9.0\VC\include\deque(1354) : see declaration of 'std::operator  <'
2>D:\OSG\osg\OpenSceneGraph\trunk\include\osg/State(2489) : error C2784: 'bool std:operator <(const std::deque<_Ty,_Alloc> &,const std::deque<_Ty,_Alloc> &)' : could not deduce template argument for 'const std::deque<_Ty,_Alloc> &' from 'const std::string'
2>        D:\Program Files\Microsoft Visual Studio 9.0\VC\include\deque(1354) : see declaration of 'std::operator  <'
2>D:\OSG\osg\OpenSceneGraph\trunk\include\osg/State(2489) : error C2784: 'bool std:operator  <(const std::deque<_Ty,_Alloc> &,const std::deque<_Ty,_Alloc> &)' : could not deduce template argument for 'const std::deque<_Ty,_Alloc> &' from 'const std::string'
2>        D:\Program Files\Microsoft Visual Studio 9.0\VC\include\deque(1354) : see declaration of 'std::operator <'
2>D:\OSG\osg\OpenSceneGraph\trunk\include\osg/State(2489) : error C2784: 'bool std::operator  <(const std::deque<_Ty,_Alloc> &,const std::deque<_Ty,_Alloc> &)' : could not deduce template argument for 'const std::deque<_Ty,_Alloc> &' from 'const std::string'
2>        D:\Program Files\Microsoft Visual Studio 9.0\VC\include\deque(1354) : see declaration of 'std::operator <'
2>D:\OSG\osg\OpenSceneGraph\trunk\include\osg/State(2489) : error C2784: 'bool std::operator  <(const std::list<_Ty,_Ax> &,const std::list<_Ty,_Ax> &)' : could not deduce template argument for 'const std::list<_Ty,_Ax> &' from 'const std::string'

该用户从未签到

 楼主| 发表于 2011-7-29 09:52:03 | 显示全部楼层
编译vpb,除了CMake的配置,还要做哪些特殊的配置么?请大家指点

该用户从未签到

发表于 2011-7-29 12:29:49 | 显示全部楼层
没有什么特殊的配置,我怀疑您的库版本不是最新的,或者说虽然您下载了最新的库,但是VPB所使用的OSG头文件并不是最新的

该用户从未签到

发表于 2011-8-24 16:57:03 | 显示全部楼层
最后怎么解决的?我也碰到了同样的问题。我在vs 2010和 vs2005下都是这个问题。
OSG确定是3.0.0的,VPB是 0.9.12的。

该用户从未签到

发表于 2011-8-25 13:21:41 | 显示全部楼层
自己顶下,试了半天解决了。
是include路径的问题,也很奇怪,VPB的早期版本可以不用指定osgDB等的路径,只需要指定OSG-INCLUDE-DIR。我用的VPB12必须都指定之后CMake才能通过,VS编译又不能包含这些目录。
解决办法是,在CMake里面指定所有路径,通过之后在VS的工程里面去掉多余的附件包含目录,编译通过。

该用户从未签到

发表于 2013-5-27 00:30:57 来自手机 | 显示全部楼层
lzf 发表于 2011-8-25 13:21
自己顶下,试了半天解决了。
是include路径的问题,也很奇怪,VPB的早期版本可以不用指定osgDB等的路径,只 ...

请问osg3.0.0版本就是和vpb12匹配吗?那vpb1.0呢?

该用户从未签到

发表于 2013-5-27 08:11:04 | 显示全部楼层
小发 发表于 2013-5-27 00:30
请问osg3.0.0版本就是和vpb12匹配吗?那vpb1.0呢?

可以还原版本 试一试

该用户从未签到

发表于 2013-5-27 09:59:03 | 显示全部楼层
建议参考trunk版本的修改一下BuildOptionsIO.cpp。
貌似主要是include后面要加上这些,后面用到的地方要进行修改
#if OSG_MIN_VERSION_REQUIRED(3,1,0)
    #define IS_BEGIN_BRACKET    is.BEGIN_BRACKET
    #define IS_END_BRACKET      is.END_BRACKET
    #define OS_BEGIN_BRACKET    os.BEGIN_BRACKET
    #define OS_END_BRACKET      os.END_BRACKET
#else
    #define IS_BEGIN_BRACKET    osgDB::BEGIN_BRACKET
    #define IS_END_BRACKET      osgDB::END_BRACKET
    #define OS_BEGIN_BRACKET    osgDB::BEGIN_BRACKET
    #define OS_END_BRACKET      osgDB::END_BRACKET
#endif

或者直接就用trunk版本的编译,一次通过,直接使用11和12版本都出问题

该用户从未签到

发表于 2013-5-27 13:00:16 | 显示全部楼层
liuzhiyu123 发表于 2013-5-27 08:11
可以还原版本 试一试

还原版本??
您需要登录后才可以回帖 登录 | 注册

本版积分规则

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

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

联系我们

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