【发布时间】:2013-01-28 19:23:35
【问题描述】:
早安。
我在使用 c++ 的 Visual Studio 2008 解决方案上有以下定义(这个程序是由在我之前在这里工作的人创建的):
[DllImport("msvcr70.dll", CallingConvention = CallingConvention::Cdecl)]
extern int _fpreset();
这条线完美无缺,我可以在代码上调用 _fpreset。
由于我们需要将其实现为 64 位应用程序,因此我安装了 Visual Studio 2010。从存储库下载解决方案后,它要求我进行转换才能正常工作。我单击是,当我尝试编译程序时,出现以下错误:
error C2556:'int _fpreset(void)': overloaded functions only differ by return type with 'void _fpreset(void)'
当我在 Visual Studio 2008 中再次尝试时,它可以完美运行...
任何想法为什么它在 2010 年不起作用?
【问题讨论】:
-
听起来 _fpreset() 被声明了不止一次。
-
是的,但是如果我删除该声明,当我使用它时,我会收到以下警告:
'_fpreset': Direct floating point control is not supported or reliable from within managed code -
嗯,是的。 The documentation 表示“公共语言运行时只支持默认的浮点精度。”
标签: .net visual-studio-2010 visual-c++