Google在Windows上用Eclipse进行测试
Google test with Eclipse on Windows
我正在尝试使用Eclipse设置google测试。以下是我目前所做的:
初始设置:- 在Eclipse Helios上安装CDT。
- 已下载并安装Cygwin。
- 下载并解压gtest.
- 使用cygwin构建gtest,使用默认的makefile。
:
- 在工具链中用Cygwin创建了一个空的可执行c++项目。
- 在c++ Build/Settings/Cygwin c++ Compiler 中添加了"[gtest_dir]include"
- 添加库路径为"[gtest_dir]make"在c++ Build/Settings/Cygwin c++ link
- Builder已经是GNU Make Builder
- 编写了一些c++代码示例并构建了项目。
当我构建项目时,我面临以下错误:
构建目标:SampleCpp.exe调用:Cygwin c++链接器g++ -L/cygdrive/d/gtest-1.7.0/make -o"SampleCpp.exe" ./src/Counter. exeo。/src/Counter_tests。o -lgtest/usr/lib/gcc/i686-pc-cygwin/4.8.2/../../../../i686-pc-cygwin/bin/ld: cannot find -lgtest makefile:45:目标'SampleCpp.exe'的配方失败
我错过了什么?
EDIT 1: [gtest_dir]make包含两个.a文件- gt。a和gtest_main.a
我也使用Eclipse Helios
EDIT 2:
它工作后,我重命名gtest。gtest.lib。这是Windows上库的预期命名格式吗?
在C/c++ Build> Settings> Tool Settings> Cygwin c++ Linker> Miscellaneous> Other Objects下,添加$GTEST_DIR/make/gtest_main.a。
这会使链接器看到gtest_main。A作为目标文件的存档,而不是库。
相关文章:
- 使用C++库在Android项目中修改gradle中的cmake参数,用于插入指令的测试
- 无法编译 rtmidi 测试 cmidiin.cpp 文件, 非法指令
- 尽管测试成功,CppUnit测试核心仍被丢弃.为什么
- 数据成员SFINAE的C++17测试:gcc vs clang
- 如何使用重载的相等(==)运算符向测试用例添加描述
- 为什么二进制搜索在我的测试中不起作用
- Google 在 Eclipse 中对 C++ 的测试覆盖率
- 如何使用Eclipse CDT中的Google测试来管理测试输出
- Eclipse CDT 中的单元测试
- 在 Eclipse 中使用 CUTE 进行C++测试
- eclipse c++单元测试快捷方式
- 用于运行测试和浏览报告的Eclipse (CDT)插件
- 对于我应该在Visual Studio和Eclipse (Code Red)中使用什么单元测试框架有什么想法吗?
- Eclipse CDT中c++的类似junit的测试框架
- 使用MinGW在Eclipse中增强单元测试不产生输出
- 在eclipse g++中进行单元测试
- Boost 单元测试编译通过 Eclipse 失败
- Google在Windows上用Eclipse进行测试
- 在eclipse中运行多个Qt测试
- Web-CAT CxxTest Eclipse GUI 用于测试结果未显示