变量未在此范围内声明 - Mingw w64

时间:2015-03-18 22:48:28

标签: c++ mingw-w64

我在Mingw 64位中收到此错误

 error: '_controlfp' was not declared in this scope

我尝试使用

包含float.h
#include <float.h>

这是我的陈述

 uint32_t old;
_controlfp_s(&old, _PC_64, _MCW_PC);

但是我仍然遇到这个问题。此外,我添加了mingw的include目录的路径作为第一个搜索路径。有关如何解决此问题的任何建议。

1 个答案:

答案 0 :(得分:0)

这个定义出现在float.h中。似乎mingw64试图在C:\mingw64\x86_64-w64-mingw32\include中的float.h中查找这个定义,但是这个定义出现在文件'C:\ mingw64 \ x86_64-w64中-mingw32 \包括”。为了解决这个问题,我将定义复制到了实际的源文件中。