首页 > 解决方案 > 编译“Hello World”程序时出错

问题描述

我正在尝试使用 CodeBlocks IDE 在我的 Mac 上运行以下简单程序:

    1.  #include <stdio.h>

    2.  int main()
    3.  {
    4.     // printf() displays the string inside quotation
    5.     printf("Hello, World!");
    6.     return 0;
    7.  }

但我收到以下错误:

错误:预期标识符或“(”

由于机器正在尝试编译,我认为 gcc 编译器工作正常。

标签: cmacoscodeblocks

解决方案


删除行号,这就是问题所在。


推荐阅读