Libc functions undefined when linking

Adam D Ruppe destructionator at gmail.com
Tue Jan 4 18:37:25 UTC 2022


On Tuesday, 4 January 2022 at 18:13:56 UTC, Ben Jones wrote:
> clang -c -o source/assignment1.o source/assignment1.c

you might have better luck just telling clang to link it too

like

clang source/assignment1.o -lphobos2 build/*.o # etc

since there's a bunch of default search paths and libs etc the 
compiler pass to the linker.

otherwise if you do need to use the linker directly worth 
remembering the order of args matter too. you need to put the 
more derived dependencies first followed by more general ones at 
the end


More information about the Digitalmars-d-learn mailing list