2010-02-20 108 views
4

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

documentation说:

如果未在标准位置安装升压,你将需要指定它。右键单击新创建的CUTE项目,然后选择属性。在C/C++ Build,Settings中,选择Tool Settings标签。在GCC C++编译器目录中指定Boost包含路径,并指定库路径和boost_thread库名称,例如boost_thread-gcc-mt-d-1_33。

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

到目前为止,我下载了boost并将目录移至/ usr/local /,然后在项目属性> C/C++ Build> Settings> Tool下的include路径列表中添加了“/ usr/local/boost_1_42_0/boost”设置> 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

尽管在许多boost库仅邮件头,some需要库(如.lib.a.dyld & c)中待建。 Here是关于建筑物boost的说明。

由于大胆的部分说“指定库路径和boost_thread库名”,似乎你应该建立助推源,以便它产生所需的库,就像你的情况libboost_thread。然后在项目设置中指定路径和该lib的名称。

除此之外,我认为你还需要指定包含路径,因为/usr/local/<boost_somthing>不可能被默认发现,因此所有那些'boost' is not a namespace-name错误。

+0

它的工作原理!我还必须右键单击>“清理项目”,这让我永远想不到。 – Imran 2010-02-20 16:08:59