来自 Visual Studio 的 std 文件中的错误
errors inside std files from Visual Studio
以下代码
#include <vector>
void main() {
std::vector<int> testing;
testing.push_back(45);
}
在我构建之前向我吐出一堆错误,奇怪的是,我的文件 main.cpp 没有错误,错误来自内部 vector.h(而且很漂亮我尝试使用的任何其他标准库)。此代码在 xcode mac 上运行良好,但在 visual studio 2015 windows 上运行良好。我不太熟悉 windows 上的编码,所以我是否遗漏了一些明显的东西?
这是大多数错误的样子(有数百个这样的错误)
Error (active) the global scope has no "float_t" Test c:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\include\cmath 688
Error (active) the global scope has no "double_t" Test c:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\include\cmath 688
Error (active) the global scope has no "nan" Test c:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\include\cmath 700
Error (active) the global scope has no "acoshf" Test c:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\include\cmath 704
Error (active) the global scope has no "asinhf" Test c:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\include\cmath 704
Error (active) the global scope has no "atanhf" Test c:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\include\cmath 704
Error (active) the global scope has no "cbrtf" Test c:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\include\cmath 705
Error (active) the global scope has no "erff" Test c:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\include\cmath 705
Error (active) the global scope has no "erfcf" Test c:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\include\cmath 705
Error (active) the global scope has no "expm1f" Test c:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\include\cmath 706
还有许多其他类型的错误,但这是前几行,如果需要,我可以 post 更多详细信息。
谢谢!
不确定发生了什么,但删除程序文件中的 visual studio 11-14 文件夹和从添加或删除程序中删除 "repairing" visual studio 有效。我以前曾尝试卸载整个程序并重新安装,但由于某种原因没有奏效。无论如何,希望有人会在某个时候从中找到一些用处。
我转到项目->属性->配置属性->常规并将 Windows SDK 版本更改为最新版本(它是 8.1,我将其更改为 10.0.10586.0)并清理干净所有错误。
以下代码
#include <vector>
void main() {
std::vector<int> testing;
testing.push_back(45);
}
在我构建之前向我吐出一堆错误,奇怪的是,我的文件 main.cpp 没有错误,错误来自内部 vector.h(而且很漂亮我尝试使用的任何其他标准库)。此代码在 xcode mac 上运行良好,但在 visual studio 2015 windows 上运行良好。我不太熟悉 windows 上的编码,所以我是否遗漏了一些明显的东西?
这是大多数错误的样子(有数百个这样的错误)
Error (active) the global scope has no "float_t" Test c:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\include\cmath 688
Error (active) the global scope has no "double_t" Test c:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\include\cmath 688
Error (active) the global scope has no "nan" Test c:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\include\cmath 700
Error (active) the global scope has no "acoshf" Test c:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\include\cmath 704
Error (active) the global scope has no "asinhf" Test c:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\include\cmath 704
Error (active) the global scope has no "atanhf" Test c:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\include\cmath 704
Error (active) the global scope has no "cbrtf" Test c:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\include\cmath 705
Error (active) the global scope has no "erff" Test c:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\include\cmath 705
Error (active) the global scope has no "erfcf" Test c:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\include\cmath 705
Error (active) the global scope has no "expm1f" Test c:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\include\cmath 706
还有许多其他类型的错误,但这是前几行,如果需要,我可以 post 更多详细信息。
谢谢!
不确定发生了什么,但删除程序文件中的 visual studio 11-14 文件夹和从添加或删除程序中删除 "repairing" visual studio 有效。我以前曾尝试卸载整个程序并重新安装,但由于某种原因没有奏效。无论如何,希望有人会在某个时候从中找到一些用处。
我转到项目->属性->配置属性->常规并将 Windows SDK 版本更改为最新版本(它是 8.1,我将其更改为 10.0.10586.0)并清理干净所有错误。