c3-web icon indicating copy to clipboard operation
c3-web copied to clipboard

Add information about the linking program to prevent linking errors.

Open EchoPouet opened this issue 4 months ago • 4 comments

Prevent compilation errors such as those encountered when compiling “hello world”.

# c3c build
sh: 1: cc: not found
Failed to link executable 'build/hello' using command 'cc -o build/toto -rdynamic -pthread ....

EchoPouet avatar Aug 13 '25 22:08 EchoPouet

Although if it's missing using --linker=builtin will work

lerno avatar Sep 16 '25 16:09 lerno

Sorry, but I tried again with a Docker container on Ubuntu 24.04 with only c3c and libxml2. The result with your option produces this error:

root@4dd523af4351:/# ./c3/c3c --linker=builtin compile  hello.c3 
Failed to find the C runtime at link time.

Furthermore, this option is not mentioned in the tutorial on compiling hello world.

EchoPouet avatar Sep 16 '25 20:09 EchoPouet

If you are in a special environment that lacks even a linker and a compiler, then you need to point to the crt files etc to link with. But odds are not even that exists in such an environment. I doubt anything can make it work in a Docker container that is missing all relevant system libraries.

lerno avatar Sep 23 '25 08:09 lerno

Perhaps the solution would be to add a paragraph listing the minimum packages/libraries required to compile a project with C3, wouldn't it ?

EchoPouet avatar Oct 02 '25 07:10 EchoPouet