我试着安装了OAT++。但是失败了。
操作系统信息
[root@localhost build]# cat /etc/*-release
CentOS Linux release 7.6.1810 (Core)如何解决下面的错误?
[ 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++安装失败?
发布于 2020-10-28 15:15:33
您有失败的测试,而不是oatpp库本身。
只需通过添加-DOATPP_BUILD_TESTS=OFF cmake标志并重新构建来禁用测试:
cmake -DOATPP_BUILD_TESTS=OFF ..
make install修复测试的:
在文件oatpp/test/oatpp/core/data/share/StringTemplateTest中,更改所有出现的类似代码:
auto result = t.format({oatpp::String("Hello")});至
auto result = t.format(std::vector<oatpp::String>({"Hello"}));如果您修复测试,请发送PR!
https://stackoverflow.com/questions/64566489
复制相似问题