Ubuntu 14.04 cpputest 示例构建失败

标签 ubuntu build cpputest

我通过以下方式在 Ubuntu 上安装了 cpputest:

sudo apt-get install cpputest

现在我尝试构建书中的示例,但失败了:

augre@ubuntu:~/tddec-code$ make
make -i -C code
make[1]: Entering directory `/home/augre/tddec-code/code'
make -f MakefileCppUTest.mk
make[2]: Entering directory `/home/augre/tddec-code/code'
MakefileCppUTest.mk:60: /build/MakefileWorker.mk: No such file or directory
make[2]: *** No rule to make target `/build/MakefileWorker.mk'.  Stop.
make[2]: Leaving directory `/home/augre/tddec-code/code'
make[1]: [all] Error 2 (ignored)
make -f MakefileUnity.mk
make[2]: Entering directory `/home/augre/tddec-code/code'
Running BookCode_Unity_tests
Unity test run 1 of 1
..........!............................................................
-----------------------
71 Tests 0 Failures 1 Ignored
OK
make[2]: Leaving directory `/home/augre/tddec-code/code'
make[1]: Leaving directory `/home/augre/tddec-code/code'
make -i -C code-t0
make[1]: Entering directory `/home/augre/tddec-code/code-t0'
Makefile:42: /build/MakefileWorker.mk: No such file or directory
make[1]: *** No rule to make target `/build/MakefileWorker.mk'.  Stop.
make[1]: Leaving directory `/home/augre/tddec-code/code-t0'
make: *** [all] Error 2

似乎找不到 apt-get 安装 cpputest 的位置。

我怎样才能弄清楚并指出它?

最佳答案

我在目录中找不到文件 MakefileWorker.mk

sudo apt-get install cpputest 

已创建。

因此决定删除这些文件

apt-get remove cpputest

然后下载源码:

cd /home/augre/bin
git clone git://github.com/cpputest/cpputest.git

然后:

$ cd cpputest_build
$ autoreconf .. -i
$ ../configure
$ make

然后设置环境变量

export CPPUTEST_HOME=/home/augre/bin/cpputest

然后修复另一个构建错误:

cp /home/augre/bin/cpputest/cpputest_build/lib/* /home/augre/bin/cpputest/lib/

关于Ubuntu 14.04 cpputest 示例构建失败,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/34851443/

相关文章:

ubuntu - getent passwd 用户名在启动时不返回任何内容

macos - 如何仅从 NSS 构建 certutil?

cpputest - CppUTest 中 undefined reference

ruby-on-rails - 将 RVM 与 GVim(奶油色)一起使用 : rvm command not found

shell - 绑定(bind)字符串(文本)粘贴到键 ubuntu

java - 使用 WindowBuilder Pro

firefox - 创建 Mozilla Firefox 的自定义构建

javascript - 文件名的下一个构建问题

c++ - 检查 C 函数是否在 C++ CppUTest 中被调用

embedded - 如何将静态库 CppUTests 添加到我的项目 atmel studio