【发布时间】:2016-09-28 23:52:26
【问题描述】:
我是第一次使用 ninja 构建程序。我从 cmd 运行命令“ninja -f hello.c”,但收到错误“ninja: error: hello.c:1: lexing error”。为什么会出现这种情况?这是我的 build.ninja 文件:
# build.ninja
cc = clang
cflags = -Weverything
rule compile
command = $cc $cflags -c $in -o $out
rule link
command = $cc $in -o $out
build hello.o: compile hello.c
build hello: link hello.o
default hello
这里是 Hello.c:
#include<stdio.h>
int main()
{
printf("Hello World");
}
【问题讨论】:
-
main()->int main() -
这并没有解决问题。