Linker error when using mq_open()


When I am trying below code I am getting linker error
mqd_t mq_id;

mq_id = mq_open(“my_queue”, O_RDWR|O_CREAT, 0777, 0);
printf(“mq_id = %d\n”, mq_id);
Error I am getting…
file mq1.o(/mq1.c) Undefined symbol mq_open_
cc: /usr/watcom/10.6/bin/wlink exited 1

Please let me know do i need to link any library to use message queue

Check in the documentation of mq_open().

I checked it …its given as I have to
cc -L c filename.c nd need to link libc… Where can I find ‘libc’

Hello Colonal,
cc –lc filename.c

with –lc “libâ€

Thanks! for the reply
Still the same error…

qcc -lc filename.c

should work fine, at least it does here.
You have a standard installation?