LinuxSir.cn,穿越时空的Linuxsir!

 找回密码
 注册
搜索
热搜: shell linux mysql
查看: 738|回复: 3

有关posix mq的问题,帮忙阿!

[复制链接]
发表于 2004-10-22 15:44:22 | 显示全部楼层 |阅读模式
我在Fedora core 2里编译了posix mq library但是不知道为什么,在程序 里就不能用posix mq 。
给出错误:undifended reference to mq_open();
请教这是怎么回事。
源程序:
#include<mqueue.h>
main(){
mqd_t mqt;
mqt=mq_open(&"test",O_CREAT);
mq_close(mqt);
exit();
}
发表于 2004-10-22 17:55:37 | 显示全部楼层
编译时要链接相应的库,我没用什么mq library就不知道具体是什么了,一般是-lmq或-llibmq或-lmqlib等等,你可以自己看说明并试试。
发表于 2004-10-25 09:51:36 | 显示全部楼层
你先看看/usr/include/目录下有没有mqueue.h这个文件
发表于 2004-10-25 10:37:18 | 显示全部楼层
我也遇到了这个问题。
这是因为在posix mq在新的NPTL里还没支持,
From: Sebastien Decugis <sebastien@ex...>
Re: unable to run test for MSG  
2004-08-19 00:14  
Then if you don"t have a very recent glibc (read: that you built
yourself) the message queue features are likely not to be supported by
your system (mq_* routines). They have been added in NPTL quite recently
(about 3 months ago IIRC) and were totally missing from LinuxThreads.

Sebastien.





On Thu, 2004-08-19 at 08:07, ganesh kumar wrote:
> my os is linux 2.4.18-14 version
>
> ----- Original Message -----
> From: Sebastien Decugis
> Date: Wed, 18 Aug 2004 15:48:04 +0200
> To: ganesh kumar
> Subject: Re: [posixtest-discuss] unable to run test for MSG
>
> > What is your operating system / libc library?
> >
> >
> > On Wed, 2004-08-18 at 14:11, ganesh kumar wrote:
> > > when i try to run individually the MSG test using ./run_test MSG .
> it
> > > gives me the following error. it is not building and linking...
> > >
> > > link :FAILED
> > >
> > > undefined reference to mq_open. i guess there is some problem in
> > > mqueue.h header file...
> > >
> > > can you help me in that and also any link to download the correct
> > > mqueue header file...
> > >
> > >
> > -------------------------------
> > Sebastien DECUGIS
> > NPTL Tes t & Trace Project
> > http://nptl.bullopensource.org/
> >
您需要登录后才可以回帖 登录 | 注册

本版积分规则

快速回复 返回顶部 返回列表