I use gcc with the commmand :
$ gcc hal.c -o hal
I tried to use "-lmach", and it couldnt find it eithor
Maybe I use an old version of glibc?
To be more clear the file use mach_msg in one place
void main(void){
mach_header_t header;
mach_return_t msg=mach_msg(header);
}
On Fri, 17 Jul 2026, 21:07 Samuel Thibault, <[email protected]> wrote:
> Hello,
>
> Again, you need to tell us what you are doing. Are you compiling under
> GNU/Hurd or under GNU/Linux? Always remember the xy problem
> https://xyproblem.info/
>
> Ahmed Khider, le ven. 17 juil. 2026 20:43:54 +0300, a ecrit:
> > When I tried to compile my c file, the linker
> >
> > throw an error : undefined reference to
>
> Since it's an undefined reference, the problem is *not* a missing
> header, but an missing link piece. But mach_msg is normally provided by
> the libc, so that can't be a missing flag or such, but rather a problem
> with your compilation chain. Thus back to the question: what are you
> actually doing?
>
> Samuel
>