当前位置: 技术问答>linux和unix
请帮忙,Linux下编译找不到sem_init函数
来源: 互联网 发布时间:2016-02-19
本文导语: 我将UNIX下的程序移植到Linux下时编译报错如下: /esscProductHouseWare/2006/libLibs/newTcpipSvrMain.20060808.o(.text+0x25): In fu nction `UnionTaskActionBeforeExit': /home/ud060402/UD-2006-04-02/tcpipSvr/newTcpipSvrMain.20060808.c:41: undefined r eference to `sem...
我将UNIX下的程序移植到Linux下时编译报错如下:
/esscProductHouseWare/2006/libLibs/newTcpipSvrMain.20060808.o(.text+0x25): In fu
nction `UnionTaskActionBeforeExit':
/home/ud060402/UD-2006-04-02/tcpipSvr/newTcpipSvrMain.20060808.c:41: undefined r
eference to `sem_destroy'
/esscProductHouseWare/2006/libLibs/newTcpipSvrMain.20060808.o(.text+0x251): In f
unction `main':
/home/ud060402/UD-2006-04-02/tcpipSvr/newTcpipSvrMain.20060808.c:100: undefined
reference to `sem_init'
/esscProductHouseWare/2006/libLibs/newTcpipSvrMain.20060808.o(.text+0x3f5):/home
/ud060402/UD-2006-04-02/tcpipSvr/newTcpipSvrMain.20060808.c:143: undefined refer
ence to `sem_wait'
/esscProductHouseWare/2006/libLibs/newTcpipSvrMain.20060808.o(.text+0x421):/home
/ud060402/UD-2006-04-02/tcpipSvr/newTcpipSvrMain.20060808.c:146: undefined refer
ence to `sem_post'
collect2: ld returned 1 exit status
make: *** [shortConnTcpipSvr.20060808] ´íÎó 1
UNIX下的程序编译没有问题,是否需要链接Linux下的哪个库,请指教,谢谢
/esscProductHouseWare/2006/libLibs/newTcpipSvrMain.20060808.o(.text+0x25): In fu
nction `UnionTaskActionBeforeExit':
/home/ud060402/UD-2006-04-02/tcpipSvr/newTcpipSvrMain.20060808.c:41: undefined r
eference to `sem_destroy'
/esscProductHouseWare/2006/libLibs/newTcpipSvrMain.20060808.o(.text+0x251): In f
unction `main':
/home/ud060402/UD-2006-04-02/tcpipSvr/newTcpipSvrMain.20060808.c:100: undefined
reference to `sem_init'
/esscProductHouseWare/2006/libLibs/newTcpipSvrMain.20060808.o(.text+0x3f5):/home
/ud060402/UD-2006-04-02/tcpipSvr/newTcpipSvrMain.20060808.c:143: undefined refer
ence to `sem_wait'
/esscProductHouseWare/2006/libLibs/newTcpipSvrMain.20060808.o(.text+0x421):/home
/ud060402/UD-2006-04-02/tcpipSvr/newTcpipSvrMain.20060808.c:146: undefined refer
ence to `sem_post'
collect2: ld returned 1 exit status
make: *** [shortConnTcpipSvr.20060808] ´íÎó 1
UNIX下的程序编译没有问题,是否需要链接Linux下的哪个库,请指教,谢谢
|
有这个东西
我man了一下
估计你没有挂到库
librt.so
挂这个库
我man了一下
估计你没有挂到库
librt.so
挂这个库