Libc functions undefined when linking

Ben Jones fake at fake.fake
Tue Jan 4 18:29:56 UTC 2022


On Tuesday, 4 January 2022 at 18:26:41 UTC, Ali Çehreli wrote:
> On 1/4/22 10:13 AM, Ben Jones wrote:
>
> > So I think I need to specify that I want to explicitly
> include libc when
> > I link it.  `-lc` didn't seem to work.
>
> Did you add -lc and -lpthread on the linker line?
>
> > ld build/*.o -L. -lphobos2 -o build/executable
>
> Ali

Maybe it's a mac thing and that will work when I get to linux, 
but I did try that and ld couldn't find the lib:

```
ld: library not found for -lc
```

Same result for -lpthread, and for -pthread (no l)


More information about the Digitalmars-d-learn mailing list