Unix网络编程(卷二)源码编译报错解决(二)

2014-11-24 13:43:26 · 作者: · 浏览: 30
ined reference to `mq_unlink'


./libunpipc.a(wrapunix.o): In function `Mq_close':


wrapunix.c:(.text+0xd3d): undefined reference to `mq_close'


./libunpipc.a(wrapunix.o): In function `Mq_open':


wrapunix.c:(.text+0xd79): undefined reference to `__mq_open_2'


wrapunix.c:(.text+0xd9e): undefined reference to `mq_open'


collect2: ld returned 1 exit status


解决办法:gcc 添加-lrt命令选项(具体查看man mq_open)


3、找不到GetOpt:


/tmp/ccv1UEy3.o: In function `main':


mqcreate1.c:(.text+0x3a): undefined reference to `GetOpt'


collect2: ld returned 1 exit status


直接把程序改了getopt,没关系。