zoukankan      html  css  js  c++  java
  • codeblock 编译googletest

    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:sourcegoogletest-release-1.7.0includegtestinternalgtest-port.h||In function 'int testing::internal::posix::StrCaseCmp(const char*, const char*)':|
    D:sourcegoogletest-release-1.7.0includegtestinternalgtest-port.h|1719|error: '_stricmp' was not declared in this scope|
    D:sourcegoogletest-release-1.7.0includegtestinternalgtest-port.h||In function 'char* testing::internal::posix::StrDup(const char*)':|
    D:sourcegoogletest-release-1.7.0includegtestinternalgtest-port.h|1721|error: '_strdup' was not declared in this scope|
    D:sourcegoogletest-release-1.7.0includegtestinternalgtest-port.h||In function 'int testing::internal::posix::FileNo(FILE*)':|
    D:sourcegoogletest-release-1.7.0includegtestinternalgtest-port.h|1729|error: '_fileno' was not declared in this scope|
    D:sourcegoogletest-release-1.7.0includegtestinternalgtest-port.h||In function 'FILE* testing::internal::posix::FDOpen(int, const char*)':|
    D:sourcegoogletest-release-1.7.0includegtestinternalgtest-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:sourcegoogletest-release-1.7.0includegtestinternalgtest-port.h||In function 'void testing::internal::SleepMilliseconds(int)':|
    D:sourcegoogletest-release-1.7.0includegtestinternalgtest-port.h|1193|error: 'nanosleep' was not declared in this scope|
    D:sourcegoogletest-release-1.7.0srcgtest-death-test.cc|123|warning: 'testing::internal::g_in_fast_death_test_child' defined but not used [-Wunused-variable]|
    CMakeFilesgtest.diruild.make|62|recipe for target 'CMakeFiles/gtest.dir/src/gtest-all.cc.obj' failed|
    CMakeFilesMakefile2|66|recipe for target 'CMakeFiles/gtest.dir/all' failed|
    D:sourcegoogletest-release-1.7.0codeblocks-mingwMakefile|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版本过老

  • 相关阅读:
    FEniCS 1.1.0 发布,计算算术模型
    Piwik 1.10 发布,增加社交网站统计
    淘宝褚霸谈做技术的心态
    CyanogenMod 10.1 M1 发布
    Druid 发布 0.2.11 版本,数据库连接池
    GNU Gatekeeper 3.2 发布
    Phalcon 0.9.0 BETA版本发布,新增大量功能
    EUGene 2.6.1 发布,UML 模型操作工具
    CVSps 3.10 发布,CVS 资料库更改收集
    Opera 移动版将采用 WebKit 引擎
  • 原文地址:https://www.cnblogs.com/hzijone/p/5926014.html
Copyright © 2011-2022 走看看