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. Hibdernate入门

    Hibernate中java对象的三种状态 瞬时状态(Transient):通过NEW创建对象后对象并没有立刻持久化他未与数据哭中的数据有任何关联 持久状态(Persistent):当对象与Sessi ...

  2. jQuery超链接提示,提示跟随鼠标动

    功能:实现鼠标移动到一个超链接时,鼠标右下角产生一个提示,并跟谁鼠标移动,知道鼠标离开超链接. 效果: 源码: <!--本案例是鼠标放在超链接上时,鼠标旁边有提示这是个超练级,以及放在图片上时图 ...

  3. IE6\7\8下placeholder效果,支持文本框和密码框

    (function($) {  var placeholderfriend = {    focus: function(s) {      s = $(s).hide().prev().show() ...

  4. Qt5.7.0配置选项(configure非常详细的参数)

    configure是一个命令行工具,用于配置Qt编译到指定平台.configure必须运行于Qt源码根目录.当运行configure时,编译源码使用的是所选工具链中的make工具. 一.源码目录.编译 ...

  5. css设置select高度(IE,FF,Chrome)[转]

    大家都知道select是无法设置高度和边框颜色等等的在ie67下面,其他的都是可以的,所以有时候为了在所有的浏览器下显示都一致,就使用了 js的模拟,这个是大家经常碰到的,js不光要模拟外观还有模拟事 ...

  6. Swift来的正是时候

    早期对ObjectiveC这玩意不是很感冒,一直没有动手搞Apple平台下的开发,现在Swift来了,时机成熟,提升门槛后的IOS,才是量子本人想弄的.现在不用担心搞ObjectiveC的走在前面了. ...

  7. HTTP协议(二):header标头说明

    Header 解释 示例 Accept-Ranges 表明服务器是否支持指定范围请求及哪种类型的分段请求 Accept-Ranges: bytes Age 从原始服务器到代理缓存形成的估算时间(以秒计 ...

  8. EL表达式怎么获取Map的动态key?

    缘由 El表达式在调用Map的时候,后台传过来的Map的key不一定是一个固定的值,需要根据另外一个对象的id作为key来put,或者更加复杂的组合id+"string"作为一个k ...

  9. JavaScript中URL的解码和编码

    这些URI方法encodeURI.encodeURIComponent().decodeURI().decodeURIComponent()代替了BOM的escape()和unescape()方法. ...

  10. Unity 难点目录

    1.mesh的任意切割.(难点) 2.扇形区域识别玩家.(解决) 3.NGUI横滑同时竖滑,或滑动同时点击冲突处理.(解决)