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

variable not declared in this scope - Mingw w64

本文关键字:变量 -Mingw w64 声明 范围      更新时间:2023-10-16

我在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目录的路径作为第一个要搜索的路径。关于如何解决此问题的任何建议。

此定义存在于float.h中。看起来mingw64试图在C:mingw64x86_64-w64-mingw32include中的float.h查找此定义,但此定义存在在文件"C:\mingw64\x86_64-w64-mingw32\include"中。为了解决这个问题,我将定义复制到实际的源文件中。