codeblock 编译googletest
1、cmake安装
2、codeblock 16.01
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的更多相关文章
- codeblock编译Object-C
http://blog.csdn.net/ldl22847/article/details/7482971 http://www.cnblogs.com/qingyuan/p/3524791.html ...
- 直接在CMake项目中编译GoogleTest和GoogleMock作为项目的一部分
直接在CMake项目中编译GoogleTest和GoogleMock作为项目的一部分 本文是关于如何将GoogleTest和GoogleMock在没有预先编译安装在机器的情况下,直接在项目中作为项目的 ...
- Linux c codeblock的使用(二):在工程中编译多个文件
(一)前言 我们刚开始学习linux c的时候,一般都是在一个c文件里面写完所有程序,然后用gcc编译这个c文件就好了,十分简单. 但是你有没有想过,如果我们希望将不同模块的代码放到不同的c文件,然后 ...
- 如何用googletest写单元测试
http://www.uml.org.cn/c++/201203293.asp googletest是一个用来写C++单元测试的框架,它是跨平台的,可应用在windows.linux.Mac等OS平台 ...
- 解决codeblock不能运行的问题
codeblock 编译失败 软件 IDE codeblock这软件的确不错,但是除此安装使用就会不小心入坑.你是不是满心欢喜的下载好codeblock,敲入代码,点击运行的时候却总是没反应呢? 如果 ...
- Linux c codeblock的使用(三):使用函数库
(一)概念 什么是函数库呢?一下子说概念大家可能不太熟悉,但是这实际上是大家在windows系统上经常见到的东西.没错,就是那些后缀为DLL的文件. linux上实际也有自己的函数库文件,文件类型为. ...
- 使用googletest进行C++单元测试(Netbeans为例)
googletest设置步骤(Netbeans为例) 下载googletest [https://github.com/google/googletest],解压到<gtest_dir> ...
- MinGW下编译openssl, json-c
目的:在windows环境下,编译开源库openssl 环境:windows 10 ,Mingw及自带msys工具,openssl-1.0.2j 工具主要使用MinGW(含msys1.0), IDE选 ...
- JAVA的String的传值和传地址问题
关于Java的String类型,可能你会碰到这种情况,将String类型的变量传到一个函数,在这个函数中修改变量的值,但是,实参的值并没有发生改变. Java中String的传值/传地址问题: 例子引 ...
随机推荐
- google的云盘与公司网盘
很多人都很期待Google推出的云存储服务,也就是公司网盘.因为多数人相信,没有比google更适合做云存储的公司了,作为一个标准的Web公司或者说互联网公司,云端理所应当的优秀.但比起几年前听传言时 ...
- .gitignore详解
今天讲讲Git中非常重要的一个文件――.gitignore. https://git-scm.com/docs/gitignore 首先要强调一点,这个文件的完整文件名就是“.gitignore”,注 ...
- ubuntu12.04中shell脚本无法使用source的原因及解决方法
现象: shell脚本中source aaa.sh时提示 source: not found 原因: ls -l `which sh` 提示/bin/sh -> dash 这说明是用dash来进 ...
- Swift来的正是时候
早期对ObjectiveC这玩意不是很感冒,一直没有动手搞Apple平台下的开发,现在Swift来了,时机成熟,提升门槛后的IOS,才是量子本人想弄的.现在不用担心搞ObjectiveC的走在前面了. ...
- Jquery揭秘系列:实现 ready和bind事件
讲这一节之前,先回顾之前的一篇<小谈Jquery>里面的代码: (function (win) { var _$ = function (selector, context) { retu ...
- LCS问题
最长公共子序列问题 1.这里pre数组表示回溯的方式,状态转移方程!!! #include <iostream> #include <algorithm> #include & ...
- 旧版青奥遇到的bug
1.Cannot create PoolableConnectionFactory (Unknown database 'yoms') 答:服务器上的库都被人删了. 2.Cannot create P ...
- 【USACO 2.4】Cow Tours (最短路)
题意:给你n(最多150)个点的坐标,给出邻接矩阵,并且整个图至少两个联通块,现在让你连接一条边,使得所有可联通的两点的最短距离的最大值最小. 题解:先dfs染色,再用floyd跑出原图的直径O($n ...
- Leetcode 40. Combination Sum II
Given a collection of candidate numbers (C) and a target number (T), find all unique combinations in ...
- Size Balance Tree(SBT模板整理)
/* * tree[x].left 表示以 x 为节点的左儿子 * tree[x].right 表示以 x 为节点的右儿子 * tree[x].size 表示以 x 为根的节点的个数(大小) */ s ...