c - Linux终端上的Hello.c错误(C语言)

标签 c linux terminal

我在终端输入:

[File: hello/hello.c]
#include <stdio.h>
int main()
{
     printf("Hello World\n");
     return (0);
}

终端踢回了两个错误:

     hello.c:1:1: error: expected identifier or ‘(’ before ‘[’ token
     [File: hello/hello.c]
     ^
     hello.c:2:19: fatal error: stdio.h: No such file or directory
     compilation terminated.

我想澄清一下我在这里做错了什么。提前谢谢你。

最佳答案

[File: hello/hello.c] 应该放在顶层。 只需将其删除或注释掉即可。

关于c - Linux终端上的Hello.c错误(C语言),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/49787720/

相关文章:

c - 我调用他们后我的功能不起作用

c++ - 无法从共享库中打开共享库,只能从可执行文件中打开

php - 如何将 linux 命令 CURL 转换为 PHP

windows - 是否可以在 Windows 上的 PowerShell 终端中有多个选项卡

mysql - 是否有基于文本的 mysql 用户界面?

c - Linux设备描述符读取/64,错误18

c - 一段时间内随机事件的数量

c - 链表有循环函数复习

c - 这个 c 程序在 windows 中工作正常但在 Linux 中不工作

terminal - 解析_git_dirty :11: command not found: tail