【发布时间】:2012-04-26 12:26:21
【问题描述】:
我目前遇到以下错误:
c:\program files\microsoft visual studio\vc98\include\iomanip(15):错误 C2059:>语法错误:“命名空间”
c:\program files\microsoft visual studio\vc98\include\iomanip(15) : error C2334: >unexpected token(s) before '{';跳过明显的函数体
c:\program files\microsoft visual studio\vc98\include\math.h(36) : error C2059: syntax >error: 'string'
c:\program files\microsoft visual studio\vc98\include\math.h(36):错误 C2334:意外 >token(s) before '{';跳过明显的函数体
由于它们都在标准库头文件中,因此是只读的,我不知道如何修复它!
任何帮助都会很棒。
【问题讨论】:
-
你正在编译的文件的后缀是什么?我怀疑它是
.c,意味着源将被视为 C,而不是 C++。 -
另一种可能性是在包含之前的代码中缺少(或不需要){ 或 }。
-
您使用的是 C 编译器还是 C++ 编译器?你的代码是 C 还是 C++?
-
事实证明,大约 50 行后,我没能在课程末尾添加 }