首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >在centos 7上安装OAT++失败

在centos 7上安装OAT++失败
EN

Stack Overflow用户
提问于 2020-10-28 12:32:51
回答 1查看 59关注 0票数 0

我试着安装了OAT++。但是失败了。

操作系统信息

代码语言:javascript
复制
[root@localhost build]# cat /etc/*-release
CentOS Linux release 7.6.1810 (Core)

如何解决下面的错误?

代码语言:javascript
复制
[ 84%] Building CXX object test/CMakeFiles/oatppAllTests.dir/oatpp/core/data/share/StringTemplateTest.cpp.o
/home/happyteam/jjumdong/oatpp/test/oatpp/core/data/share/StringTemplateTest.cpp: In member function 'virtual void oatpp::test::core::data::share::StringTemplateTest::onRun()':
/home/happyteam/jjumdong/oatpp/test/oatpp/core/data/share/StringTemplateTest.cpp:38:52: error: call of overloaded 'format(<brace-enclosed initializer list>)' is ambiguous
     auto result = t.format({oatpp::String("Hello")});
                                                    ^
/home/happyteam/jjumdong/oatpp/test/oatpp/core/data/share/StringTemplateTest.cpp:38:52: note: candidates are:
In file included from /home/happyteam/jjumdong/oatpp/test/oatpp/core/data/share/StringTemplateTest.cpp:27:0:
/home/happyteam/jjumdong/oatpp/src/oatpp/core/data/share/StringTemplate.hpp:175:17: note: oatpp::String oatpp::data::share::StringTemplate::format(const std::vector<oatpp::data::mapping::type::String>&) const
   oatpp::String format(const std::vector<oatpp::String>& params) const;
                 ^
/home/happyteam/jjumdong/oatpp/src/oatpp/core/data/share/StringTemplate.hpp:189:17: note: oatpp::String oatpp::data::share::StringTemplate::format(const String&) const
   oatpp::String format(const oatpp::String& singleValue) const;
                 ^

我成功地在ubuntu上安装了OAT++。

为什么在centos 7上OAT++安装失败?

EN

回答 1

Stack Overflow用户

发布于 2020-10-28 15:15:33

您有失败的测试,而不是oatpp库本身。

只需通过添加-DOATPP_BUILD_TESTS=OFF cmake标志并重新构建来禁用测试:

代码语言:javascript
复制
cmake -DOATPP_BUILD_TESTS=OFF ..
make install

修复测试的

在文件oatpp/test/oatpp/core/data/share/StringTemplateTest中,更改所有出现的类似代码:

代码语言:javascript
复制
auto result = t.format({oatpp::String("Hello")});

代码语言:javascript
复制
auto result = t.format(std::vector<oatpp::String>({"Hello"}));

如果您修复测试,请发送PR!

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/64566489

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档