vs2010编译osg源码问题:error C2780

错误如下:

5>InitializeBuildStatus:
5>  Creating "example_osgmultiplemovies.dir\Debug\Examples osgmultiplemovies.unsuccessfulbuild" because "AlwaysCreate" was specified.
5>CustomBuild:
5>  All outputs are up-to-date.
5>ClCompile:
5>  osgmultiplemovies.cpp
5>..\..\..\examples\osgmultiplemovies\osgmultiplemovies.cpp(654): error C2780: 'const _Ty &std::max(const _Ty &,const _Ty &,_Pr)' : expects 3 arguments - 2 provided
5>          D:\Program Files\Microsoft Visual Studio 10.0\VC\include\xutility(2086) : see declaration of 'std::max'
5>..\..\..\examples\osgmultiplemovies\osgmultiplemovies.cpp(654): error C2782: 'const _Ty &std::max(const _Ty &,const _Ty &)' : template parameter '_Ty' is ambiguous
5>          D:\Program Files\Microsoft Visual Studio 10.0\VC\include\xutility(2078) : see declaration of 'std::max'
5>          could be 'double'
5>          or       'float'
5>
5>Build FAILED.


解决办法:定位到出错文件osgmultiplemovies.cpp

将654行   unsigned int num_files_per_row = std::max(osg::round(sqrt(static_cast<float>(std::min(max_videos, static_cast<unsigned int>(files.size()))))), 1.0);
改为:unsigned int num_files_per_row = std::max(osg::round(sqrt(static_cast<float>(std::min(max_videos, static_cast<unsigned int>(files.size()))))),(static_cast<float> (1.0))); 

重新编译 ok


参考:http://forum.openscenegraph.org/viewtopic.php?t=11325

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值