Ubuntu13.10下Cppunit1.12.1安装记录

环境介绍

ubuntu version: 13.10
gcc, g++ version: 4.8.1
cppunit version: 1.12.1

cppunit 能够在该处下载cppunit传送门ubuntu

安装过程

解压之后, 安装仍然是传统的三步骤:测试

  1. ./configure
  2. make
  3. sudo make install

configure的过程可以很容易的经过, 当进行make的时候, 则出现了以下的错误:.net

g++ -g -O2 -o .libs/DllPlugInTester DllPlugInTester.o CommandLineParser.o  -ldl ../../src/cppunit/.libs/libcppunit.so -lm 
../../src/cppunit/.libs/libcppunit.so: undefined reference to `dlsym'
../../src/cppunit/.libs/libcppunit.so: undefined reference to `dlopen'
../../src/cppunit/.libs/libcppunit.so: undefined reference to `dlclose'
collect2: error: ld returned 1 exit status
make[2]: *** [DllPlugInTester] Error 1
make[2]: Leaving directory `/home/xc-pc/software/cppunit-1.12.1/src/DllPlugInTester'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/home/xc-pc/software/cppunit-1.12.1/src'
make: *** [all-recursive] Error 1

从上面的提示能够看出, 问题是出在DllPlugInTester编译的过程当中, 出现这个问题的可能缘由是g++的版本为4.8.1.code

解决办法

cd到DllPlugInTester目录下,get

vi Makefile

LDFLAGS=后面加上, LDFLAGS=-Wl,--no-as-need, 而后再次make, 若是在其余的目录又出现相似的问题, 用一样的方法进行处理便可. 最后利用sudo make install完成安装it

具体测试时候的问题

在具体使用的过程当中, 会出现找不到libcppunit.so.1**相似的错误, 缘由是没有将路径添加到环境变量, 能够经过如下步骤实现:io

  1. vi /etc/ld.so.conf添加一行/usr/local/lib而后运行sudo ldconfig便可
  2. export LD_LIBRARY_PATH=/usr/local/lib:$LD_LIBRARY_PATH
相关文章
相关标签/搜索