1、cmake安装

2、codeblock  16.01

3、Google Test 1.7.0

4、PATH路径添加(重启电脑,保证设置的PATH路径生效)

5、python安装

6、编译安装:  http://www.cnblogs.com/TenosDoIt/p/3412721.html

错误:

||=== Build: Debug in d (compiler: GNU GCC Compiler) ===|
D:\source\googletest-release-1.7.0\include\gtest\internal\gtest-port.h||In function 'int testing::internal::posix::StrCaseCmp(const char*, const char*)':|
D:\source\googletest-release-1.7.0\include\gtest\internal\gtest-port.h|1719|error: '_stricmp' was not declared in this scope|
D:\source\googletest-release-1.7.0\include\gtest\internal\gtest-port.h||In function 'char* testing::internal::posix::StrDup(const char*)':|
D:\source\googletest-release-1.7.0\include\gtest\internal\gtest-port.h|1721|error: '_strdup' was not declared in this scope|
D:\source\googletest-release-1.7.0\include\gtest\internal\gtest-port.h||In function 'int testing::internal::posix::FileNo(FILE*)':|
D:\source\googletest-release-1.7.0\include\gtest\internal\gtest-port.h|1729|error: '_fileno' was not declared in this scope|
D:\source\googletest-release-1.7.0\include\gtest\internal\gtest-port.h||In function 'FILE* testing::internal::posix::FDOpen(int, const char*)':|
D:\source\googletest-release-1.7.0\include\gtest\internal\gtest-port.h|1779|error: 'fdopen' was not declared in this scope|
||=== Build failed: 4 error(s), 0 warning(s) (0 minute(s), 0 second(s)) ===|

解决: 在codeblocks上的build-options上去除-std=C++11 ,添加-std=gnu++

错误:

||=== Build: all in gtest (compiler: GNU GCC Compiler) ===|
D:\source\googletest-release-1.7.0\include\gtest\internal\gtest-port.h||In function 'void testing::internal::SleepMilliseconds(int)':|
D:\source\googletest-release-1.7.0\include\gtest\internal\gtest-port.h|1193|error: 'nanosleep' was not declared in this scope|
D:\source\googletest-release-1.7.0\src\gtest-death-test.cc|123|warning: 'testing::internal::g_in_fast_death_test_child' defined but not used [-Wunused-variable]|
CMakeFiles\gtest.dir\build.make|62|recipe for target 'CMakeFiles/gtest.dir/src/gtest-all.cc.obj' failed|
CMakeFiles\Makefile2|66|recipe for target 'CMakeFiles/gtest.dir/all' failed|
D:\source\googletest-release-1.7.0\codeblocks-mingw\Makefile|82|recipe for target 'all' failed|
||=== Build failed: 4 error(s), 1 warning(s) (0 minute(s), 1 second(s)) ===|

解决:注释  nanosleep 这一行

编译Google Test 1.8.0,出现很多编译错误,有可能是Mingw版本过老

codeblock 编译googletest的更多相关文章

  1. codeblock编译Object-C

    http://blog.csdn.net/ldl22847/article/details/7482971 http://www.cnblogs.com/qingyuan/p/3524791.html ...

  2. 直接在CMake项目中编译GoogleTest和GoogleMock作为项目的一部分

    直接在CMake项目中编译GoogleTest和GoogleMock作为项目的一部分 本文是关于如何将GoogleTest和GoogleMock在没有预先编译安装在机器的情况下,直接在项目中作为项目的 ...

  3. Linux c codeblock的使用(二):在工程中编译多个文件

    (一)前言 我们刚开始学习linux c的时候,一般都是在一个c文件里面写完所有程序,然后用gcc编译这个c文件就好了,十分简单. 但是你有没有想过,如果我们希望将不同模块的代码放到不同的c文件,然后 ...

  4. 如何用googletest写单元测试

    http://www.uml.org.cn/c++/201203293.asp googletest是一个用来写C++单元测试的框架,它是跨平台的,可应用在windows.linux.Mac等OS平台 ...

  5. 解决codeblock不能运行的问题

    codeblock 编译失败 软件 IDE codeblock这软件的确不错,但是除此安装使用就会不小心入坑.你是不是满心欢喜的下载好codeblock,敲入代码,点击运行的时候却总是没反应呢? 如果 ...

  6. Linux c codeblock的使用(三):使用函数库

    (一)概念 什么是函数库呢?一下子说概念大家可能不太熟悉,但是这实际上是大家在windows系统上经常见到的东西.没错,就是那些后缀为DLL的文件. linux上实际也有自己的函数库文件,文件类型为. ...

  7. 使用googletest进行C++单元测试(Netbeans为例)

    googletest设置步骤(Netbeans为例) 下载googletest [https://github.com/google/googletest],解压到<gtest_dir> ...

  8. MinGW下编译openssl, json-c

    目的:在windows环境下,编译开源库openssl 环境:windows 10 ,Mingw及自带msys工具,openssl-1.0.2j 工具主要使用MinGW(含msys1.0), IDE选 ...

  9. JAVA的String的传值和传地址问题

    关于Java的String类型,可能你会碰到这种情况,将String类型的变量传到一个函数,在这个函数中修改变量的值,但是,实参的值并没有发生改变. Java中String的传值/传地址问题: 例子引 ...

随机推荐

  1. [No00007E]2016-面经[中]

    目录: 写一份动人简历的九个步奏 英文简历必备的十大元素 写一份动人简历的九个步骤 写一份动人的简历可以算得上是找工作最难的部分之一,但是,通过下面九步,这件事不再那么难了. 简历定位.雇主们之所以花 ...

  2. Java.utils.Collections学习

    阅读类库代码是有意义的,尤其是Java集合类框架以及算法Collections Arrays都是值得阅读的, 一来可以减少新手程序员的编码的工作量,二来,对于常见的需求,程序员应该先找下是否有现成的类 ...

  3. AngularJS中的模板安全与作用域绑定

    欢迎大家指导与讨论 : ) 一.前言 摘要:指令compile.$sce.作用域绑定.$compileProvider和其他资源安全设置.本文是笔者在学习时整理的笔记,由于技术还不够高,如果本章中有错 ...

  4. Python-09-paramiko模块

    开发堡垒机之前,先来学习一下Python的paramiko模块,该模块基于SSH用于连接远程服务器并执行相关操作. SSHClient 用于连接远程服务器并执行基本命令 基于用户名密码连接 impor ...

  5. BIOS设置和CMOS设置的区别与联系

    BIOS是主板上的一块EPROM或EEPROM芯片,里面装有系统的重要信息和设置系统参数的设置程序(BIOS Setup程序): CMOS是主板上的一块可读写的RAM 芯片,里面装的是关于系统配置的具 ...

  6. bzoj 2287: 【POJ Challenge】消失之物

    Description ftiasch 有 N 个物品, 体积分别是 W1, W2, ..., WN. 由于她的疏忽, 第 i 个物品丢失了. "要使用剩下的 N - 1 物品装满容积为 x ...

  7. ie与火狐中常见的一些兼容问题

    1. document.form.item 问题 (1)现有问题: 现有代码中存在许多 document.formName.item("itemName") 这样的语句,不能在Fi ...

  8. Switch&NAT 测试

    测试环境: PC1:Windows10 iperf3 PC2:Ubuntu iperf3 都装有千兆网卡,直连的iperf速度是935Mbps. 因为TXRX两个方向的数据是差不多的,下面的测试数据只 ...

  9. Spring.Net 简单入门学习

    Spring.NET IoC容器的用法. 通过简单的例子学习Spring.Net 1.先创建一个控制台程序项目. 2.添加IUserInfoDal 接口. namespace Spring.Net { ...

  10. 风口之下,猪都能飞。当今中国股市牛市,真可谓“错过等七年”。 给你一个回顾历史的机会,已知一支股票连续n天的价格走势,以长度为n的整数数组表示,

    转自:http://www.cnblogs.com/ranranblog/p/5845010.html 风口之下,猪都能飞.当今中国股市牛市,真可谓“错过等七年”. 给你一个回顾历史的机会,已知一支股 ...