c - Visual C++ 无法识别注释行?

标签 c visual-c++ compilation compiler-errors stdio

我的程序的第一行是:

/* Arquivo testaesparsas.c */

并且,在编译之后,我得到了那些(以及许多其他)错误消息:

visual studio 2010\projects\matrizes esparsas\matrizes esparsas\testeesparsas.c(1): error C2061: syntax error : identifier 'testaesparsas'

visual studio 2010\projects\matrizes esparsas\matrizes esparsas\testeesparsas.c(1): error C2059: syntax error : ';'

visual studio 2010\projects\matrizes esparsas\matrizes esparsas\testeesparsas.c(1): error C2059: syntax error : '.'

visual studio 2010\projects\matrizes esparsas\matrizes esparsas\testeesparsas.c(1): warning C4138: '*/' found outside of comment

令人惊讶的是,我在错误消息中发现了附加到 native 库(如 stdio.h)的错误:

1>c:\arquivos de programas\microsoft visual studio 10.0\vc\include\stdio.h(245): error C2059: syntax error : ')'

1>c:\arquivos de programas\microsoft visual studio 10.0\vc\include\stdio.h(247): error C2143: syntax error : missing '{' before '__cdecl'

1>c:\arquivos de programas\microsoft visual studio 10.0\vc\include\stdio.h(247): error C2146: syntax error : missing ')' before identifier '_DstSize'

1>c:\arquivos de programas\microsoft visual studio 10.0\vc\include\stdio.h(247): error C2081: 'size_t' : name in formal parameter list illegal

可能发生了什么?

最佳答案

visual studio 2010\projects\matrizes esparsas\matrizes esparsas\testeesparsas.c(1): warning C4138: '*/' found outside of comment

此警告可能是由于尝试嵌套评论或如果您在评论前键入“*”引起的:

int */*comment*/ptr;

a = b */*comment*/c;

关于c - Visual C++ 无法识别注释行?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/19338565/

相关文章:

winapi - 窗口不响应消息

c++ - 静态库

javascript - CoffeeScript : if . 。是..那么

c - 赋值从指针目标类型中丢弃 'volatile' 限定符

c - 当未连接的顶点使用权重矩阵的值为 -1 时,C 中的 Dijkstra 算法

c# - Unity 插件在 OpenGL 4.1 中不工作,在 OpenGL 2.1 中工作

c++ - 无法将 id 分配给 OpenGL 中的属性

c++ - 如何在非 MFC 项目中使用 TRACE 宏?

c++ - 为什么允许在 noexcept 标记的函数中抛出异常?

c# - 从 C# 程序运行 C# 编译器