c - gcc c 编译错误

标签 c gcc

尝试编译时

#include<stdio.h>

int main(){

printf("Hello World");

return 0;

}

我在 Solaris11 gcc 中遇到以下错误:

  1. hello.c:4:23: 错误:';' 之前的预期表达式 token

  2. hello.c:6:1: 错误:应为 ';'在 '}' 标记之前

Visual C++ 可以编译这段代码。

最佳答案

第四行(return 语句)中的“;”不是标准的“;”。

关于c - gcc c 编译错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/42921432/

相关文章:

c - 这些 LAPACK 计划有何不同之处?一个编译,另一个不编译

c++ - 将 Autotools 用于新的共享库

c - 通过 POSIX tdelete() 访问节点数据

c - 示例 : scanf and char errors

c++ - GCC : literal string types in a structure 中的可能错误

c++ - eclipse /海湾合作委员会 : Undefined Reference to Extern Variable

C 什么时候 char** 应该以 null 终止?

c - 移除叶子不影响 BST - C

c++ - 如何将 printf 流输出重定向到 .csv 文件?

linux - mpm-itk 安装 -- make : missing: Command not found on ubuntu