我尝试执行 Project-OSRM 的examle.cpp文件。我做了以下步骤:
- 如此处所述,从源代码构建 OSRM
- 在新终端中: cd osrm-backend/example
- 在终端:cmake ..
- 在终端: cmake --build 。
- 在终端: sudo cmake --build 。--目标安装
- 将地图承包商、引擎、提取器、分区、存储、实用程序从/usr/local/include/osrm 移动到/ usr/local/include(否则错误地图不在 /usr/local/include 中)
- 在终端中: g++ -std=c++11 example.cpp -o example
但我得到了错误
‘underlying_type_t’ in namespace ‘std’ does not name a template type
static_cast<std::underlying_type_t<RouteParameters::AnnotationsType>>
有谁知道我做错了什么或出了什么问题以及如何解决这个问题?
错误信息
In file included from /usr/local/include/engine/api/match_parameters.hpp:31:0,
from /usr/local/include/osrm/match_parameters.hpp:31,
from example.cpp:1:
/usr/local/include/engine/api/route_parameters.hpp: In function ‘bool osrm::engine::api::operator&(osrm::engine::api::RouteParameters::AnnotationsType, osrm::engine::api::RouteParameters::AnnotationsType)’:
/usr/local/include/engine/api/route_parameters.hpp:144:26: error: ‘underlying_type_t’ in namespace ‘std’ does not name a template type
static_cast<std::underlying_type_t<RouteParameters::AnnotationsType>>(l
^
/usr/local/include/engine/api/route_parameters.hpp:144:43: error: expected ‘>’ before ‘<’ token
static_cast<std::underlying_type_t<RouteParameters::AnnotationsType>>(l
^
/usr/local/include/engine/api/route_parameters.hpp:144:43: error: expected ‘(’ before ‘<’ token
/usr/local/include/engine/api/route_parameters.hpp:144:43: error: expected primary-expression before ‘<’ token
/usr/local/include/engine/api/route_parameters.hpp:144:76: error: expected primary-expression before ‘>>’ token
static_cast<std::underlying_type_t<RouteParameters::AnnotationsType>>(lhs) &
^
/usr/local/include/engine/api/route_parameters.hpp:145:26: error: ‘underlying_type_t’ in namespace ‘std’ does not name a template type
static_cast<std::underlying_type_t<RouteParameters::AnnotationsType>>(r
^
/usr/local/include/engine/api/route_parameters.hpp:145:43: error: expected ‘>’ before ‘<’ token
static_cast<std::underlying_type_t<RouteParameters::AnnotationsType>>(r
^
/usr/local/include/engine/api/route_parameters.hpp:145:43: error: expected ‘(’ before ‘<’ token
/usr/local/include/engine/api/route_parameters.hpp:145:43: error: expected primary-expression before ‘<’ token
/usr/local/include/engine/api/route_parameters.hpp:145:76: error: expected primary-expression before ‘>>’ token
static_cast<std::underlying_type_t<RouteParameters::AnnotationsType>>(rhs));
^
/usr/local/include/engine/api/route_parameters.hpp:145:84: error: expected ‘)’ before ‘;’ token
static_cast<std::underlying_type_t<RouteParameters::AnnotationsType>>(rhs));
^
/usr/local/include/engine/api/route_parameters.hpp:145:84: error: expected ‘)’ before ‘;’ token
/usr/local/include/engine/api/route_parameters.hpp: In function ‘osrm::engine::api::RouteParameters::AnnotationsType osrm::engine::api::operator|(osrm::engine::api::RouteParameters::AnnotationsType, osrm::engine::api::RouteParameters::AnnotationsType)’:
/usr/local/include/engine/api/route_parameters.hpp:152:26: error: ‘underlying_type_t’ in namespace ‘std’ does not name a template type
static_cast<std::underlying_type_t<RouteParameters::AnnotationsType>>(l
^
/usr/local/include/engine/api/route_parameters.hpp:152:43: error: expected ‘>’ before ‘<’ token
static_cast<std::underlying_type_t<RouteParameters::AnnotationsType>>(l
^
/usr/local/include/engine/api/route_parameters.hpp:152:43: error: expected ‘(’ before ‘<’ token
/usr/local/include/engine/api/route_parameters.hpp:152:43: error: expected primary-expression before ‘<’ token
/usr/local/include/engine/api/route_parameters.hpp:152:76: error: expected primary-expression before ‘>>’ token
static_cast<std::underlying_type_t<RouteParameters::AnnotationsType>>(lhs) |
^
/usr/local/include/engine/api/route_parameters.hpp:153:26: error: ‘underlying_type_t’ in namespace ‘std’ does not name a template type
static_cast<std::underlying_type_t<RouteParameters::AnnotationsType>>(r
^
/usr/local/include/engine/api/route_parameters.hpp:153:43: error: expected ‘>’ before ‘<’ token
static_cast<std::underlying_type_t<RouteParameters::AnnotationsType>>(r
^
/usr/local/include/engine/api/route_parameters.hpp:153:43: error: expected ‘(’ before ‘<’ token
/usr/local/include/engine/api/route_parameters.hpp:153:43: error: expected primary-expression before ‘<’ token
/usr/local/include/engine/api/route_parameters.hpp:153:76: error: expected primary-expression before ‘>>’ token
static_cast<std::underlying_type_t<RouteParameters::AnnotationsType>>(rhs));
^
/usr/local/include/engine/api/route_parameters.hpp:153:84: error: expected ‘)’ before ‘;’ token
static_cast<std::underlying_type_t<RouteParameters::AnnotationsType>>(rhs));
^
/usr/local/include/engine/api/route_parameters.hpp:153:84: error: expected ‘)’ before ‘;’ token