【问题标题】:Visual C++ isn't recognizing comment lines?Visual C++ 不识别注释行?
【发布时间】:2013-10-12 19:55:47
【问题描述】:

我的程序的第一行是:

/* 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

令人惊讶的是,我在错误消息中发现附加到本机库(如 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

可能会发生什么?

【问题讨论】:

  • 它在抱怨 ; 时甚至没有那个字符。我不认为你正在编译你认为的文件。
  • 评论说测试 ae sparses,但错误说测试 ee parsas
  • Barmar,其实我是:/
  • @LB--,单词是“testaesparsas”,但存档的名称是“testeesparsas.c”...不要以为这就是重点
  • 源文件是否会以 UTF-8 BOM 标头保存?

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


【解决方案1】:
visual studio 2010\projects\matrizes esparsas\matrizes esparsas\testeesparsas.c(1): warning C4138: '*/' found outside of comment

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

int */*comment*/ptr;

a = b */*comment*/c;

【讨论】:

    猜你喜欢
    • 2014-05-24
    • 2018-06-24
    • 1970-01-01
    • 1970-01-01
    • 2013-01-30
    • 2020-12-11
    • 2020-04-07
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多