技术宅,fat-man

增加语言的了解程度可以避免写出愚蠢的代码

导航

gtest编译小结(ubuntu 12.10 , gtest 1.6.0)

1 下载源码,解压之当前用户的主目录(~/)

2 进入make目录,执行make命令

cd ~/gtest-1.6.0/make
make

3 在ubuntu里编译出错,提示找不到lthread库。修改Makefile,在文件结尾:

sample1_unittest : sample1.o sample1_unittest.o gtest_main.a
    $(CXX) $(CPPFLAGS) $(CXXFLAGS) -lpthread $^ -o $@

修改成(-lpthread 移到命令末尾):

sample1_unittest : sample1.o sample1_unittest.o gtest_main.a
    $(CXX) $(CPPFLAGS) $(CXXFLAGS) $^ -o $@ -lpthread

 http://www.cnblogs.com/coderzh/archive/2009/04/06/1426755.html

posted on 2013-08-01 18:29  codestyle  阅读(495)  评论(0编辑  收藏  举报