消息队列 makefile 错误:未定义对“mq_open”的引用

gra*_*kin 4 linux makefile message-queue

尽管我已经-lrt在我的 Makefile 中链接了,正如你在下面看到的,我仍然得到undefined reference to 'mq_open'. 请帮忙!

all:get1 iserv1
get: get1.c
    gcc -Wall -o get1 get1.c -lrt
iserv: iserv1.c
    gcc -Wall -o iserv1 iserv1.c -lrt
clean:
    rm -fr *~ get1 iserv1
Run Code Online (Sandbox Code Playgroud)

Alo*_*sad 5

注意 -lrt 应该位于末尾而不是中间。