环境:Ubuntu 14.04 LTS
编译安装xerces-c
下载xerces-c-Xerces-C_3_1_0_rc1.tar.gz
tar zxvf xerces-c-Xerces-C_3_1_0_rc1.tar.gz
cd xerces-c-Xerces-C_3_1_0_rc1
xerces-c-Xerces-C_3_1_0_rc1$ ./configure
xerces-c-Xerces-C_3_1_0_rc1$ make
遇到以下错误:
../src/.libs/libxerces-c.so: undefined reference to `libiconv'
../src/.libs/libxerces-c.so: undefined reference to `libiconv_close'
../src/.libs/libxerces-c.so: undefined reference to `libiconv_open'
collect2: error: ld returned 1 exit status
解决方案:
下载libiconv-1.15.tar.gz
tar zxvf libiconv-1.15.tar.gz
cd libiconv-1.15
libiconv-1.15$ ./configure
libiconv-1.15$ make
libiconv-1.15$ make install
安装完成libiconv后回到xerces-c-Xerces-C_3_1_0_rc1目录下
cd src
/xerces-c-Xerces-C_3_1_0_rc1/src$ vi Makefile
找到LIBS = -lnsl -lpthread
修改为LIBS = -liconv -lnsl -lpthread
make clean
make
sudo make install
问题解决
网友评论