查看: 3076|回复: 2

OSG编译报错!

[复制链接]

该用户从未签到

发表于 2011-12-28 23:17:22 | 显示全部楼层 |阅读模式
本帖最后由 xairwolfcn 于 2011-12-28 23:20 编辑

今天用SVN把OSG更新了下!然后CMAKE下开始编译下了出现这个错误!
不知道你们谁遇到过!网上查了下,应该没有问题,况且我对比了好几个版本的OSG出错的代码写的都一样,以前的版本都能编译通过!感觉VS2008有问题!??谁见过!
  1. 1>------ Build started: Project: osg, Configuration: Debug Win32 ------
  2. 1>Compiling...
  3. 1>Matrixf.cpp
  4. 1>e:\osgcompile\openscenegraph\src\osg\Matrix_implementation.cpp(70) : warning C4003: not enough actual parameters for macro 'min'
  5. 1>e:\osgcompile\openscenegraph\src\osg\Matrix_implementation.cpp(70) : error C2589: '(' : illegal token on right side of '::'
  6. 1>e:\osgcompile\openscenegraph\src\osg\Matrix_implementation.cpp(70) : error C2059: syntax error : '::'
  7. 1>e:\osgcompile\openscenegraph\src\osg\Matrix_implementation.cpp(71) : error C2143: syntax error : missing ';' before '{'
  8. 1>e:\osgcompile\openscenegraph\src\osg\Matrix_implementation.cpp(76) : error C2181: illegal else without matching if
  9. 1>Matrixd.cpp
  10. 1>e:\osgcompile\openscenegraph\src\osg\Matrix_implementation.cpp(70) : warning C4003: not enough actual parameters for macro 'min'
  11. 1>e:\osgcompile\openscenegraph\src\osg\Matrix_implementation.cpp(70) : error C2589: '(' : illegal token on right side of '::'
  12. 1>e:\osgcompile\openscenegraph\src\osg\Matrix_implementation.cpp(70) : error C2059: syntax error : '::'
  13. 1>e:\osgcompile\openscenegraph\src\osg\Matrix_implementation.cpp(71) : error C2143: syntax error : missing ';' before '{'
  14. 1>e:\osgcompile\openscenegraph\src\osg\Matrix_implementation.cpp(76) : error C2181: illegal else without matching if
  15. 1>Generating Code...
  16. 1>Build log was saved at "file://e:\OSGCompile\OSGBuild\src\osg\osg.dir\Debug\BuildLog.htm"
  17. 1>osg - 8 error(s), 2 warning(s)
  18. ========== Build: 0 succeeded, 1 failed, 2 up-to-date, 0 skipped ==========
复制代码
出问题的代码段!
  1. void Matrix_implementation::setRotate(const Quat& q)
  2. {
  3.     double length2 = q.length2();
  4.     if (fabs(length2) <= std::numeric_limits<double>::min())
  5.     {
  6.         _mat[0][0] = 0.0; _mat[1][0] = 0.0; _mat[2][0] = 0.0;
  7.         _mat[0][1] = 0.0; _mat[1][1] = 0.0; _mat[2][1] = 0.0;
  8.         _mat[0][2] = 0.0; _mat[1][2] = 0.0; _mat[2][2] = 0.0;
  9.     }
  10.     else
  11.     {
  12.         double rlength2;
复制代码

该用户从未签到

发表于 2011-12-30 15:40:41 | 显示全部楼层
这个没有用过,我是直接在网上下载发布版本的maya2osg-0.4.2-src。里面有生成的工程maya2osg.sln,直接在VS2008下编译OK。再次打开maya2010,上面就安装好了maya2osg插件。但是点击快速转换按钮,就会报错“Warning: Could not find plugin to write nodes to file ...”
也就无法正常导出文件,丢失大量的信息。
跪求解决法案!
方便的话加我QQ1142800426,咱们进一步讨论!

该用户从未签到

 楼主| 发表于 2011-12-30 17:45:26 | 显示全部楼层
本帖最后由 xairwolfcn 于 2011-12-30 17:45 编辑

vc 的编译器就是个混蛋
  1. std::numeric_limits<double>::min()
复制代码
改成
  1. (std::numeric_limits<double>::min)()
复制代码
编译一遍,没有问题!!在换成原来的编译就好了!哎!
您需要登录后才可以回帖 登录 | 注册

本版积分规则

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

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

联系我们

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