我在 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:\mingw64\x86_64-w64-mingw32\include
中的 float.h 中寻找这个定义但是这个定义存在于文件“C:\mingw64\x86_64-w64-mingw32\include”中。为了解决这个问题,我将定义复制到实际的源文件中。
关于c++ - 未在此范围内声明的变量 - Mingw w64,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/29134150/