【问题标题】:Set up CUTE (Eclipse CDT Unit Testing Plugin) on OSX在 OSX 上设置 CUTE(Eclipse CDT 单元测试插件)
【发布时间】:2010-02-20 22:36:26
【问题描述】:

我正在尝试为 Eclipse C/C++ 开发工具设置 CUTE 单元测试插件。

documentation 说:

如果您没有在标准位置安装 Boost,则需要指定它。右键单击新创建的 CUTE 项目,然后选择属性。在 C/C++ Build, Settings 中,选择 Tool Settings 选项卡。在 GCC C++ Compiler, Directories 中指定 Boost 包含路径,并指定库路径和 boost_thread 库名称,例如 boost_thread-gcc-mt-d-1_33。

粗体部分在说什么?我不知道它要我做什么。

到目前为止,我下载了 boost 并将目录移动到 /usr/local/,然后我将“/usr/local/boost_1_42_0/boost”添加到 Project Properties > C/C++ Build > Settings > Tool Settings 下的包含路径列表中> GCC C++ 编译器 > 我的可爱项目中的目录,但 Eclipse 仍然给我很多错误和警告,表明它找不到提升,例如:

Errors:
Description Resource    Path    Location    Type
'boost_or_tr1' has not been declared    cute_suite_test.h   /helloworld/cute    line 45 C/C++ Problem
'boost_or_tr1' has not been declared    cute_test.h /helloworld/cute    line 53 C/C++ Problem
'boost_or_tr1' was not declared in this scope   cute_testmember.h   /helloworld/cute    line 30 C/C++ Problem
'boost_or_tr1' was not declared in this scope   cute_testmember.h   /helloworld/cute    line 34 C/C++ Problem
'boost' is not a namespace-name cute_equals.h   /helloworld/cute    line 41 C/C++ Problem
'boost' is not a namespace-name cute_suite_test.h   /helloworld/cute    line 33 C/C++ Problem
'boost' is not a namespace-name cute_test.h /helloworld/cute    line 34 C/C++ Problem

Warnings:
Description Resource    Path    Location    Type
boost/bind.hpp: No such file or directory   cute_suite_test.h   /helloworld/cute    line 32 C/C++ Problem
boost/function.hpp: No such file or directory   cute_test.h /helloworld/cute    line 33 C/C++ Problem
boost/type_traits/is_floating_point.hpp: No such file or directory  cute_equals.h   /helloworld/cute    line 34 C/C++ Problem
boost/type_traits/is_integral.hpp: No such file or directory    cute_equals.h   /helloworld/cute    line 33 C/C++ Problem
boost/type_traits/make_signed.hpp: No such file or directory    cute_equals.h   /helloworld/cute    line 35 C/C++ Problem

这是我大约 10 年来第一次尝试 C++ 开发,我真的迷失了。任何帮助将不胜感激!

【问题讨论】:

    标签: c++ unit-testing eclipse-cdt


    【解决方案1】:

    虽然boost 中的许多库仅是标头,但some 需要构建库(如.lib .a .dyld &c)。 Here 是关于构建 boost 的说明。

    正如粗体部分所说的“指定库路径和 boost_thread 库名称”,您似乎应该构建 boost 源,以便它生成所需的库,例如您的情况 libboost_thread。然后在项目设置中指定该库的路径和名称。

    除此之外,我认为您还需要指定包含路径,因为默认情况下不太可能找到 /usr/local/<boost_somthing>,因此所有这些 'boost' is not a namespace-name 错误。

    【讨论】:

    • 有效!我还必须右键单击 >“清理项目”,这让我永远想通了。
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2011-02-18
    • 2016-01-31
    • 2010-11-12
    • 2015-02-23
    • 1970-01-01
    • 2010-11-08
    • 2011-10-31
    相关资源
    最近更新 更多