编译静态expect现undefined reference to `openpty' 错误解决方法

版权声明:本文为博主原创文章,未经博主允许不得转载。 https://blog.csdn.net/force_eagle/article/details/6075305

错误提示如下:

...

 

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

 

没有更多推荐了,返回首页