简体   繁体   中英

Error in compilation of “Hello World” program

I am trying to run a simple program below on my mac using CodeBlocks IDE:

    1.  #include <stdio.h>

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

but I get the following error:

error: expected identifier or '('

As the machine is trying to compile, I think gcc compiler is working fine.

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

尝试使用其他IDE,找出问题出在哪里,无论是在Codeblocks IDE配置中还是在编译器本身中。

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM