在 OSX 上设置 CUTE(Eclipse CDT 单元测试插件)

发布于 2024-08-22 16:17:03 字数 2158 浏览 1 评论 0原文

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

文档 说:

如果您没有在标准位置安装 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”添加到“项目属性”>“项目属性”下的包含路径列表中。 C/C++ 构建 >设置>工具设置> GCC C++ 编译器 >我的可爱项目中的目录,但 Eclipse 仍然给我很多错误和警告,表明它找不到 boost,例如:

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++ 开发,我真的迷失了这里。任何帮助将不胜感激!

I am trying to set up the CUTE unit testing plugin for Eclipse C/C++ Development Tools.

The documentation says:

If you did not install Boost in the standard location, you will need to specify it. Right click on the newly created CUTE project, and select Properties. In C/C++ Build, Settings, choose the Tool Settings tab. Specify the Boost include path in GCC C++ Compiler, Directories, and specify the library path and the boost_thread library name, for example, boost_thread-gcc-mt-d-1_33.

What is the bolded part talking about? I have no idea what it is asking me to do.

So far I downloaded boost and moved the directory to /usr/local/, then I added "/usr/local/boost_1_42_0/boost" to the include path list under Project Properties > C/C++ Build > Settings > Tool Settings > GCC C++ Compiler > Directories in my Cute Project, but Eclipse is still giving me lots of errors and warnings indicating that it cannot find boost, eg:

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

This is my first time attempting C++ development in about 10 years and I am really lost here. Any help would be greatly appreciated!

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

魂ガ小子 2024-08-29 16:17:03

虽然 boost 中的许多库仅包含标头,一些需要库(如.lib .a .dyld & c) 待建。 此处 是有关构建 boost 的说明。

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

除此之外,我认为您还需要指定包含路径,因为默认情况下不太可能找到 /usr/local/ ,因此所有这些 'boost' 都不是命名空间名称错误。

While many libraries in boost are header-only, some require libraries (as in .lib .a .dyld &c) to be built. Here are instructions on building boost.

As the bold part says "specify the library path and the boost_thread library name", it seems like you should build boost sources so that it produces needed libraries, like in your case libboost_thread. Then specify path and the name of that lib in your project settings.

Apart from that I think you also need to specify include paths, as /usr/local/<boost_somthing> is not likely to be found by default, hence all those 'boost' is not a namespace-name errors.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文