错误提示如下:
...
gcc \
-pipe -O2 -fomit-frame-pointer -Wall \
-Wl,--export-dynamic \
-o expect exp_main_exp.o \
-L/work/pkgs/expect5.45 -lexpect5.45 \
-L/work/pkgs/tcl8.5.9/unix -ltcl8.5 \
-ldl -lieee -lm \
-Wl,-rpath,/usr/local/lib \
-Wl,-rpath,/usr/local/lib/expect5.45
/work/pkgs/expect5.45/libexpect5.45.a(pty_termios.o): In function `exp_getptymaster':
pty_termios.c:(.text+0x2f5): undefined reference to `openpty'
collect2: ld returned 1 exit status
make: *** [expect] Error 1
解决方法:
添加util链接库 -lutil
本文解决了一个具体的gcc编译链接错误,该错误出现在使用expect库进行编译的过程中。通过添加-lutil参数成功链接了util库,解决了undefined reference to `openpty'的问题。
4208

被折叠的 条评论
为什么被折叠?



