|
我的配置是 Fedora core2
我在里面使用 Posix msg queue。但是出了问题。
用GCC 编译的时候:
我已经include <mqueue.h>了
我用 gcc编译说
[root@chuxue epoll]# gcc common.c epollserver.c -o epollserver -lmqueue
/usr/bin/ld: cannot find -lmqueue
collect2: ld returned 1 exit status
不用 -lmqueue
[root@chuxue epoll]# gcc common.c epollserver.c -o epollserver
/tmp/ccNixVZB.o(.text+0x67): In function `eph_createmq':
: undefined reference to `mq_open'
/tmp/ccNixVZB.o(.text+0x9c): In function `eph_createmq':
: undefined reference to `mq_unlink'
collect2: ld returned 1 exit status
[root@chuxue epoll]#
后来在GOOGLE上找到国外一论坛上的消息:
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/
> >
按照他的说法,就是linuxthreads里不支持mq msg queue,而改由NPTL支持。
请问我怎么才能把程序连接到NPTL?
我看了一下,Fedora core2好像默认的就是NPTL。。。
不知道有没有兄弟能帮我指点一下? |
|