在OSX上设置CUTE(Eclipse CDT Unit Testing Plugin)

时间:2010-02-20 13:13:51

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

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

documentation说:

  

如果您未在标准位置安装Boost,则需要指定它。右键单击新创建的CUTE项目,然后选择“属性”。在“C / C ++构建,设置”中,选择“工具设置”选项卡。在GCC C ++编译器,目录,中指定Boost包含路径,并指定库路径和boost_thread库名称,例如boost_thread-gcc-mt-d-1_33。

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

到目前为止,我下载了boost并将目录移动到/ usr / local /,然后我将“/ usr / local / boost_1_42_0 / boost”添加到Project Properties>下的include路径列表中。 C / C ++ Build>设置>工具设置> 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

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

1 个答案:

答案 0 :(得分:1)

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

正如粗体部分所说“指定库路径和boost_thread库名”,看起来你应该构建boost源,以便生成所需的库,就像你的libboost_thread一样。然后在项目设置中指定路径和该lib的名称。

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