2008년 12월 18일 목요일

ld: Unsatisfied symbol "sem_unlink" 에러를 만났을때..

sem_unlink라는 심볼이 거시기 하다는 링크 에러 메세지..

nm -A /usr/lib/* 2>/dev/null | grep sem_open

이렇게 하면 sem_unlink가 있는 라이브러리를 쭉.... 보여 준다...

/usr/lib/libc.0:__ksem_open| 1229272|extern|entry |
/usr/lib/libc.0:__ksem_open| 1229312|extern|code |$CODE$
/usr/lib/libc.0:_sem_open| 1258936|extern|entry |
/usr/lib/libc.0:_sem_open| 1258984|extern|code |$CODE$
/usr/lib/libc.0:sem_open| 1258960|extern|entry |
/usr/lib/libc.0:sem_open| 1258984|extern|code |$CODE$
/usr/lib/libc.1:__ksem_open| 1229272|extern|entry |
/usr/lib/libc.1:__ksem_open| 1229312|extern|code |$CODE$
/usr/lib/libc.1:_sem_open| 1258936|extern|entry |
/usr/lib/libc.1:_sem_open| 1258984|extern|code |$CODE$
/usr/lib/libc.1:sem_open| 1258960|extern|entry |
/usr/lib/libc.1:sem_open| 1258984|extern|code |$CODE$
/usr/lib/libc_r.sl:__ksem_open| 1229272|extern|entry |
/usr/lib/libc_r.sl:__ksem_open| 1229312|extern|code |$CODE$
/usr/lib/libc_r.sl:_sem_open| 1258936|extern|entry |
/usr/lib/libc_r.sl:_sem_open| 1258984|extern|code |$CODE$
/usr/lib/libc_r.sl:sem_open| 1258960|extern|entry |
/usr/lib/libc_r.sl:sem_open| 1258984|extern|code |$CODE$
/usr/lib/librt.2:__ksem_open| 14288|extern|code |$CODE$
/usr/lib/librt.2:sem_open| 10432|extern|entry |
/usr/lib/librt.2:sem_open| 10504|extern|code |$CODE$
/usr/lib/librt.sl:__ksem_open| 14288|extern|code |$CODE$
/usr/lib/librt.sl:sem_open| 10432|extern|entry |
/usr/lib/librt.sl:sem_open| 10504|extern|code |$CODE$


그럼 링크에서 -lrt를 추가 해줘야 링크가 되겠다...