c++ - ms vc++ iostream 编译错误

标签 c++ visual-studio

Microsoft Visual C++ 2010 Express 中的以下代码:

#include <iostream>
//using namespace std;

int main(int argc, char **argv)
{


 return(0);

}

给我错误:

1>C:\Program Files\Microsoft Visual Studio 10.0\VC\include\cmath(19): error C2061: syntax error : identifier 'acosf'
...
1>C:\Program Files\Microsoft Visual Studio 10.0\VC\include\cmath(41): fatal error C1003: error count exceeds 100; stopping compilation
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========

如果注释掉“#include”,那么它会编译。我从现有代码创建了一个项目并编辑成上面的内容。

最佳答案

将扩展名从 .c 更改为 .cpp

关于c++ - ms vc++ iostream 编译错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/3376224/

相关文章:

c++ - Qt自定义小部件错误

wpf - MSIX 使用 Azure SSO 的已安装 WPF 应用程序将无法启动

c# - 如何手动将库添加到 visual studio 2017 项目中?

c++ - 函数内的动态内存删除

c++ - 为什么 SHGetFolderPath() 会发生内存泄漏? (C++)

c++ - GCC 4.4.7 无法从初始化列表转换为 std::array

visual-studio - Visual Studio 2012 中的 Edit.MoveLineUp/Down 发生了什么

c++ - 将长字符流写入文本文件 QT C++

visual-studio - Visual Studio : Break on variable change?

c++ - 如何在 visual studio 中链接 dll?