草庐IT

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

coder 2024-02-25 原文

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

documentation说:

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.

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

到目前为止,我下载了 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++ 开发,我真的迷失在这里。任何帮助将不胜感激!

最佳答案

虽然很 multimap 书馆在boost仅标题,some需要构建库(如 .lib .a .dyld &c)。 Here是建筑说明boost .

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

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

关于c++ - 在 OSX 上设置 CUTE(Eclipse CDT 单元测试插件),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/2302288/

有关c++ - 在 OSX 上设置 CUTE(Eclipse CDT 单元测试插件)的更多相关文章

  1. ruby - 使用 RubyZip 生成 ZIP 文件时设置压缩级别 - 2

    我有一个Ruby程序,它使用rubyzip压缩XML文件的目录树。gem。我的问题是文件开始变得很重,我想提高压缩级别,因为压缩时间不是问题。我在rubyzipdocumentation中找不到一种为创建的ZIP文件指定压缩级别的方法。有人知道如何更改此设置吗?是否有另一个允许指定压缩级别的Ruby库? 最佳答案 这是我通过查看ruby​​zip内部创建的代码。level=Zlib::BEST_COMPRESSIONZip::ZipOutputStream.open(zip_file)do|zip|Dir.glob("**/*")d

  2. ruby-on-rails - 使用 Ruby on Rails 进行自动化测试 - 最佳实践 - 2

    很好奇,就使用ruby​​onrails自动化单元测试而言,你们正在做什么?您是否创建了一个脚本来在cron中运行rake作业并将结果邮寄给您?git中的预提交Hook?只是手动调用?我完全理解测试,但想知道在错误发生之前捕获错误的最佳实践是什么。让我们理所当然地认为测试本身是完美无缺的,并且可以正常工作。下一步是什么以确保他们在正确的时间将可能有害的结果传达给您? 最佳答案 不确定您到底想听什么,但是有几个级别的自动代码库控制:在处理某项功能时,您可以使用类似autotest的内容获得关于哪些有效,哪些无效的即时反馈。要确保您的提

  3. ruby-openid:执行发现时未设置@socket - 2

    我在使用omniauth/openid时遇到了一些麻烦。在尝试进行身份验证时,我在日志中发现了这一点:OpenID::FetchingError:Errorfetchinghttps://www.google.com/accounts/o8/.well-known/host-meta?hd=profiles.google.com%2Fmy_username:undefinedmethod`io'fornil:NilClass重要的是undefinedmethodio'fornil:NilClass来自openid/fetchers.rb,在下面的代码片段中:moduleNetclass

  4. ruby - 如何每月在 Heroku 运行一次 Scheduler 插件? - 2

    在选择我想要运行操作的频率时,唯一的选项是“每天”、“每小时”和“每10分钟”。谢谢!我想为我的Rails3.1应用程序运行调度程序。 最佳答案 这不是一个优雅的解决方案,但您可以安排它每天运行,并在实际开始工作之前检查日期是否为当月的第一天。 关于ruby-如何每月在Heroku运行一次Scheduler插件?,我们在StackOverflow上找到一个类似的问题: https://stackoverflow.com/questions/8692687/

  5. ruby-on-rails - 无法使用 Rails 3.2 创建插件? - 2

    我对最新版本的Rails有疑问。我创建了一个新应用程序(railsnewMyProject),但我没有脚本/生成,只有脚本/rails,当我输入ruby./script/railsgeneratepluginmy_plugin"Couldnotfindgeneratorplugin.".你知道如何生成插件模板吗?没有这个命令可以创建插件吗?PS:我正在使用Rails3.2.1和ruby​​1.8.7[universal-darwin11.0] 最佳答案 随着Rails3.2.0的发布,插件生成器已经被移除。查看变更日志here.现在

  6. ruby - 使用 C 扩展开发 ruby​​gem 时,如何使用 Rspec 在本地进行测试? - 2

    我正在编写一个包含C扩展的gem。通常当我写一个gem时,我会遵循TDD的过程,我会写一个失败的规范,然后处理代码直到它通过,等等......在“ext/mygem/mygem.c”中我的C扩展和在gemspec的“扩展”中配置的有效extconf.rb,如何运行我的规范并仍然加载我的C扩展?当我更改C代码时,我需要采取哪些步骤来重新编译代码?这可能是个愚蠢的问题,但是从我的gem的开发源代码树中输入“bundleinstall”不会构建任何native扩展。当我手动运行rubyext/mygem/extconf.rb时,我确实得到了一个Makefile(在整个项目的根目录中),然后当

  7. ruby - Ruby 的 Hash 在比较键时使用哪种相等性测试? - 2

    我有一个围绕一些对象的包装类,我想将这些对象用作散列中的键。包装对象和解包装对象应映射到相同的键。一个简单的例子是这样的:classAattr_reader:xdefinitialize(inner)@inner=innerenddefx;@inner.x;enddef==(other)@inner.x==other.xendenda=A.new(o)#oisjustanyobjectthatallowso.xb=A.new(o)h={a=>5}ph[a]#5ph[b]#nil,shouldbe5ph[o]#nil,shouldbe5我试过==、===、eq?并散列所有无济于事。

  8. ruby-on-rails - 如何优雅地重启 thin + nginx? - 2

    我的瘦服务器配置了nginx,我的ROR应用程序正在它们上运行。在我发布代码更新时运行thinrestart会给我的应用程序带来一些停机时间。我试图弄清楚如何优雅地重启正在运行的Thin实例,但找不到好的解决方案。有没有人能做到这一点? 最佳答案 #Restartjustthethinserverdescribedbythatconfigsudothin-C/etc/thin/mysite.ymlrestartNginx将继续运行并代理请求。如果您将Nginx设置为使用多个上游服务器,例如server{listen80;server

  9. ruby-on-rails - 如何使用 instance_variable_set 正确设置实例变量? - 2

    我正在查看instance_variable_set的文档并看到给出的示例代码是这样做的:obj.instance_variable_set(:@instnc_var,"valuefortheinstancevariable")然后允许您在类的任何实例方法中以@instnc_var的形式访问该变量。我想知道为什么在@instnc_var之前需要一个冒号:。冒号有什么作用? 最佳答案 我的第一直觉是告诉你不要使用instance_variable_set除非你真的知道你用它做什么。它本质上是一种元编程工具或绕过实例变量可见性的黑客攻击

  10. ruby - RSpec - 使用测试替身作为 block 参数 - 2

    我有一些Ruby代码,如下所示:Something.createdo|x|x.foo=barend我想编写一个测试,它使用double代替block参数x,这样我就可以调用:x_double.should_receive(:foo).with("whatever").这可能吗? 最佳答案 specify'something'dox=doublex.should_receive(:foo=).with("whatever")Something.should_receive(:create).and_yield(x)#callthere

随机推荐