- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我不确定是否理解我收到的 undefined reference 。
./cxxtest/cxxtestgen.py -o tests.cpp --error-printer DrawTestSuite.h
g++ -I./cxxtest/ -c tests.cpp
g++ -o tests tests.o Color.o
tests.o: In function `DrawTestSuite::testLinewidthOne()':
tests.cpp:(.text._ZN13DrawTestSuite16t… undefined reference to `Linewidth::Linewidth(double)'
tests.cpp:(.text._ZN13DrawTestSuite16t… undefined reference to `Linewidth::draw(std::basic_ostream<char… std::char_traits<char> >&)'
collect2: ld returned 1 exit status
make: *** [tests] Error 1// DrawTestSuite.h
DrawTestSuite.h 包含单元测试和测试函数调用 Linewidth.h 以执行构造函数和成员函数 draw。
我在 DrawTestSuite.h 中有 #include "Linewidth.h"
。
最佳答案
“ undefined reference ”是一个链接器错误,当一个函数已经被正确地声明和使用,但是在链接时还没有包含定义。
您需要链接 Linewidth.o,它是编译 Linewdith.cpp 的目标文件以及实现这些功能的可能位置。
我不熟悉 cxxtest,不知道它希望您如何指定该依赖项,但我怀疑它只需要一个简单的声明。
关于c++ - 当我运行 cxxtest 时,出现 undefined reference 错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/2635300/
我希望动态扩展我的 CxxTest Suite有额外的测试项目,但我发现所有测试场景必须在编译时可用(硬编码)。 我的场景是我有一个相当庞大的 C++ 类,其中有 20 多个方法要测试。此类需要针对
我编写了以下CMakeLists.txt 以使用CxxTest 构建测试器(这几乎是FindCxxTest 提供的标准示例): cmake_minimum_required(VERSION 2.8)
这是一个奇怪的问题,我不知道该怎么做。 我有如下内容: struct Parms { const std::string value1; const std::string value
我希望你能帮助我。我在我的主要开发机器上使用 CxxTest 编写了一个小项目。在这台机器上一切正常,没有问题。但是,我尝试在我全新的笔记本电脑上设置这个项目,但无法让它工作!我怀疑我的 MinGW
我正在使用 CxxTest 进行单元测试。我跟着文档。 我执行的第一个命令是: cxxtestgen --error-printer -o runner.cpp MyTestSuite1.h 命令的输
我目前正在做一个项目,我使用: boost 库 v1.39 Eclipse CDT (Juno) 和 Cygwin CxxTest 插件:http://wiki.web-cat.org/WCWiki/
我正在尝试为我的 open source project hosted on Github 添加 Travis-Ci 支持 CMake 尝试查找 CxxTest 时出现问题。 Travis-Ci 在旧
我刚刚下载了 cxxtest 的 4.4 版并将我的 zip 文件解压到这个路径:C:/cxxtest-4.4。紧接着,我没有执行任何其他步骤,而是打开了 CLion 并尝试将 CxxTest 添加到
我需要在我的对象中临时放置一个 main() 函数来测试替代功能(除了简单的单元测试),但我一直不得不注释掉我的 main() 运行我的单元测试的函数。 是否有 CxxTest 的 #define _
CxxTest documentation有一个生成和运行单元测试的 Makefile 示例。我如何为 automake (Makefile.am) 做同样的事情? 最佳答案 我通过在 tests 目
我正在尝试在 Eclipse 上使用 CxxTest 框架执行测试用例。按照本网站上的说明进行操作后 - http://web-cat.cs.vt.edu/eclipse/cxxtest/ 我能够构建
我有一组使用 gtest 作为框架的单元测试。 构建并执行,输出如下所示: 我希望输出类似于使用 cxxunit 时的输出(. 测试通过时,失败时详细错误)。如果可能的话,用颜色。 如何做到这一点?
我不确定是否理解我收到的 undefined reference 。 ./cxxtest/cxxtestgen.py -o tests.cpp --error-printer DrawTestSuit
是否可以使用 cxxunit或任何其他单元测试框架(不包括 QtTestLib )来测试 qt 小部件? 如果是,那么还有两个问题: 如何? 由于我正在使用 valgrind 运行单元测试,这会报告一
我与一个开发基于 MPI 的 C++ 数值应用程序的团队合作。该小组使用 cxxtest 来构建单独的单元测试或小型套件,但是 1) 跨目录聚合具有 cxxtest 的常用功能存在一些复杂性,并且 2
我是一名优秀的程序员,十分优秀!