簡體   English   中英

在 centos 7 上安裝 OAT++ 失敗

[英]OAT++ installation failed on centos 7

我嘗試安裝 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++ 失敗?

您有失敗的測試,而不是 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!

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM