./configure && make -j$(nproc) && sudo make install
我通过对从 克隆的 pcc进行经典操作,构建了一个定制的 pcc https://github.com/IanHarvey/pcc
。
它可以正常编译 hello-world C 文件,但与pcc
Ubuntu repo 中预构建的文件不同,它无法链接,并显示错误消息:
ld: cannot find crtbegin.o: No such file or directory
ld: cannot find -lpcc: No such file or directory
error: ld terminated with status 1
我该如何解决?
编辑:
亲爱的不评论、要求关闭的反对者:别再拘泥于把所有事情都说清楚了。如今,机器可以推断出“编译和链接一个 hello-world 文件”99.9% 意味着运行:
$ pcc hw.c
(因为这与 pcc 有关)关于一些 hw.c:
#include <stdio.h>
int main(void){ puts("hello world"); return 0; }
如果机器可以如此智能(或者至少可以礼貌地询问更多信息),那么人类肯定也可以。