letoh’s workshop

June 21, 2008

libreadline.so.5: undefined symbol: PC

Filed under: Linux, Note — letoh @ 12:54 am

這兩天在 slackware 12.1 環境編譯一個有用到 readline 的程式,可是搞了老半天編譯好的程式都沒有 readline 跟 history 的功能。測試一下發現會出現 undefined symbol 的訊息,按照 maillist 上提供的指令 ldd -d -r /usr/lib/libreadline.so.5.2 出現這些訊息:

undefined symbol: PC (/usr/lib/libreadline.so.5.2)
undefined symbol: UP (/usr/lib/libreadline.so.5.2)
undefined symbol: BC (/usr/lib/libreadline.so.5.2)
undefined symbol: tgetflag (/usr/lib/libreadline.so.5.2)
undefined symbol: tgetent (/usr/lib/libreadline.so.5.2)
undefined symbol: tputs (/usr/lib/libreadline.so.5.2)
undefined symbol: tgoto (/usr/lib/libreadline.so.5.2)
undefined symbol: tgetnum (/usr/lib/libreadline.so.5.2)
undefined symbol: tgetstr (/usr/lib/libreadline.so.5.2)

查了一下發現這些東西在 libtermcap 裡,比較簡單一點的方法就是修改 Makefile 或 build script,在 linking 時加上 libtermcap 即可

No Comments Yet »

No comments yet.

RSS feed for comments on this post. TrackBack URI

Leave a comment

Blog at WordPress.com.