gpt4 book ai didi

c++ - 错误 C2084 : function 'float cbrt(float) throw()' already has a body

转载 作者:塔克拉玛干 更新时间:2023-11-03 07:49:27 24 4
gpt4 key购买 nike

我在visual studio 2010平台下成功编译了这个项目,但是在vs 2013中出现了这些错误:

 C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\INCLUDE\math.h(1045) : see previous definition of 'cbrt'
d:\documents\qtprojecttest\rtsc\project4\trimesh2\include\Vec.h(657) : error C2084: function 'long double cbrt(long double) throw()' already has a body
C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\INCLUDE\math.h(1161) : see previous definition of 'cbrt'
d:\documents\qtprojecttest\rtsc\project4\trimesh2\include\Vec.h(664) : error C2084: function 'float round(float) throw()' already has a body
C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\INCLUDE\math.h(1125) : see previous definition of 'round'
d:\documents\qtprojecttest\rtsc\project4\trimesh2\include\Vec.h(672) : error C2084: function 'long double round(long double) throw()' already has a body
C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\INCLUDE\math.h(1241) : see previous definition of 'round'
d:\documents\qtprojecttest\rtsc\project4\trimesh2\include\Vec.h(679) : error C2084: function 'float trunc(float) throw()' already has a body
C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\INCLUDE\math.h(1143) : see previous definition of 'trunc'
d:\documents\qtprojecttest\rtsc\project4\trimesh2\include\Vec.h(687) : error C2084: function 'long double trunc(long double) throw()' already has a body

我想知道为什么会有这样的差异,如何解决?

最佳答案

为什么 VS2010 和 VS2013 有这么大的区别?因为VS2010没有cbrt的定义,而VS2013有。所以可以使用_MSC_VER,或者直接在Vec.h中注释repeat function body。

关于c++ - 错误 C2084 : function 'float cbrt(float) throw()' already has a body,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/31783760/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com