问题1:
[root@testicehost test]# c++ -o server Printer.o Server.o -L$ICE_HOME/lib -lIce -lIceUtil
/opt/rh/devtoolset-3/root/usr/libexec/gcc/x86_64-redhat-linux/4.9.2/ld: Printer.o: undefined reference to symbol 'pthread_mutexattr_settype@@GLIBC_2.2.5'
//lib64/libpthread.so.0: error adding symbols: DSO missing from command line
collect2: error: ld returned 1 exit status
解决:
加入-lpthread
-lpthread
问题2:
/root/software/ICE/Ice-3.5.1/cpp/lib/libIce.so: undefined reference to `libiconv'
/root/software/ICE/Ice-3.5.1/cpp/lib/libIce.so: undefined reference to `libiconv_close'
/root/software/ICE/Ice-3.5.1/cpp/lib/libIce.so: undefined reference to `libiconv_open'
解决: 加入-liconv (如果没有安装此处下载:https://ftp.gnu.org/pub/gnu/libiconv/)
c++ -o client Printer.o Client.o -L$ICE_HOME/lib -lIce -lIceUtil -lpthread -liconv