I made a customized pcc build by doing doing the classical ./configure && make -j$(nproc) && sudo make install
on pcc cloned from https://github.com/IanHarvey/pcc
.
It compiles (pcc -c hw.c
) a hello-world C file like:
#include <stdio.h>
int main(void){ puts("hello world"); return 0; }
fine but unlike the prebuilt pcc
from the Ubuntu repo, it fails to "compile & link" (pcc hw.c
) giving the error message:
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
How do I fix this?
The pcc
repo only contains the core compiler. You also need to download, compile and install the pcc-libs
repo at https://github.com/IanHarvey/pcc-libs. This includes the standard include files, libpcc, crtbegin and more.
It's likely the Ubuntu package combined the two repos into one package, or had one as a dependency on the other so it auto-installed. THe EPEL 7 pcc package has them combined.