我有一个 C 程序如下:
#include<stdio.h>
void main()
{
printf("Hello");
}
文件名是linkedlist.c
和makefile在同一目录下如下
build: linkedlist.c
gcc -Wall -g -pedantic linkedlist.c -o linkedlist
run:
./linkedlist
我首先做 Mx compile 然后 make build 然后是 Mx compile ->make run 输出如下:
-*- mode: compilation; default-directory: "/home/amey/test/" -*-
Compilation started at Sat Sep 22 16:59:13
make run
./linkedlist
Hello make: *** [run] Error 5
Compilation exited abnormally with code 2 at Sat Sep 22 16:59:13
以 ./ 运行时生成的文件没有错误。有人可以解释发生了什么吗?