linkinmal 0 Newbie Poster

I'm writing a c code, we can include mqueue.h and write the function mq_open with the arguments, but it won't build.

I know it's a problem with the linking, I need to add -l libname or something to the linker. But I don't know what to write there and how to do it. Could someone tell me the lib to add for message queues? I have tried some but it didn't work.

And how do we add it? gcc -o name name.c and then what? something with -l or -L but I couldn't succeed yet

Thanks