<div dir="ltr"><p style="font-size:13px;border:medium none;margin:0px 0px 13px;padding:0px;line-height:18.2px;max-width:700px;color:rgb(0,0,0);font-family:sans-serif">Hi,</p><p style="font-size:13px;border:medium none;margin:0px 0px 13px;padding:0px;line-height:18.2px;max-width:700px;color:rgb(0,0,0);font-family:sans-serif">I am trying to compile project which uses osrm libraries and was written in 2017.I installed osrm server on my system yesterday and trying to make the application run.But while compiling on ubuntu 18.04 i am getting compilation errors.For eg,for the following code block</p><pre style="white-space:pre-wrap;background-color:rgb(245,245,245);font-family:Consolas,Monaco,"Liberation Mono","Lucida Console",monospace;font-size:11.7px;margin-bottom:10px;overflow:auto;padding-left:5px;padding-top:5px;width:580px;color:rgb(0,0,0)"><code style="font-family:Consolas,Monaco,"Liberation Mono","Lucida Console",monospace;font-size:10.53px">long long int OSRM_INTERFACE::viarouteCall(
vector<pair<float, float> > locations) {
// The following shows how to use the Route service; configure this service
osrm::RouteParameters route_parameters;
// route is in Monaco
route_parameters.service = "route";//route bateesh made chanfe from viaroutes to route
for (unsigned int i = 0; i < locations.size(); i++) {
route_parameters.AddCoordinate(locations[i].first, locations[i].second);
}
osrm::json::Object json_result;
const int result_code = (*routing_machine).RunQuery(route_parameters,
json_result);
//std::cout << "result code: " << result_code << std::endl;
long long int duration = 0;
// 2xx code
if (result_code / 100 == 2) {
// Extract data out of JSON structure
auto& summary = json_result.values["route_summary"].get<
osrm::json::Object>();
duration = summary.values["total_time"].get<osrm::json::Number>().value;
// auto distance =
// summary.values["total_distance"].get<osrm::json::Number>().value;
// //std::cout << "duration: " << duration << std::endl;
//std::cout << "distance: " << distance << std::endl;
}
//delete osrm;
return duration;
}</code></pre><pre style="white-space:pre-wrap;background-color:rgb(245,245,245);font-family:Consolas,Monaco,"Liberation Mono","Lucida Console",monospace;font-size:11.7px;margin-bottom:10px;overflow:auto;padding-left:5px;padding-top:5px;width:580px;color:rgb(0,0,0)"><code style="font-family:Consolas,Monaco,"Liberation Mono","Lucida Console",monospace;font-size:10.53px"><p style="border:medium none;margin:0px 0px 13px;padding:0px;font-size:13px;line-height:18.2px;max-width:700px;font-family:sans-serif;white-space:normal;background-color:rgb(255,255,255)">I am getting error during compilation like:-</p><br class="gmail-m_6150002194467680780gmail-Apple-interchange-newline"></code></pre><pre style="white-space:pre-wrap;background-color:rgb(245,245,245);font-family:Consolas,Monaco,"Liberation Mono","Lucida Console",monospace;font-size:11.7px;margin-bottom:10px;overflow:auto;padding-left:5px;padding-top:5px;width:580px;color:rgb(0,0,0)"><code style="font-family:Consolas,Monaco,"Liberation Mono","Lucida Console",monospace;font-size:10.53px"><pre style="white-space:pre-wrap;font-family:Consolas,Monaco,"Liberation Mono","Lucida Console",monospace;font-size:11.7px;margin-bottom:10px;overflow:auto;padding-left:5px;padding-top:5px;width:580px"><code style="font-family:Consolas,Monaco,"Liberation Mono","Lucida Console",monospace;font-size:10.53px">error: ‘struct osrm::engine::api::RouteParameters’ has no member named ‘service’; did you mean ‘overview’?
route_parameters.service = "viaroute";
^~~~~~~
overview
src/osrm_interface.cpp:47:20: error: ‘struct osrm::engine::api::RouteParameters’ has no member named ‘AddCoordinate’; did you mean ‘coordinates’?
route_parameters.AddCoordinate(locations[i].first, locations[i].second);
^~~~~~~~~~~~~
coordinates
src/osrm_interface.cpp:51:45: error: ‘class osrm::OSRM’ has no member named ‘RunQuery’
const int result_code = (*routing_machine).RunQuery(route_parameters,</code></pre></code></pre><pre style="white-space:pre-wrap;background-color:rgb(245,245,245);font-family:Consolas,Monaco,"Liberation Mono","Lucida Console",monospace;font-size:11.7px;margin-bottom:10px;overflow:auto;padding-left:5px;padding-top:5px;width:580px;color:rgb(0,0,0)"><code style="font-family:Consolas,Monaco,"Liberation Mono","Lucida Console",monospace;font-size:10.53px"><br></code></pre><pre style="white-space:pre-wrap;background-color:rgb(245,245,245);font-family:Consolas,Monaco,"Liberation Mono","Lucida Console",monospace;font-size:11.7px;margin-bottom:10px;overflow:auto;padding-left:5px;padding-top:5px;width:580px;color:rgb(0,0,0)"><code style="font-family:Consolas,Monaco,"Liberation Mono","Lucida Console",monospace;font-size:10.53px">It seems to me as some API has changed and my machine is using new APIs and the code is built on old API.Can you tell me how can I see which parameters changes if i am correct?How do I make changes in the current code to use member names of new API?<br></code></pre><pre style="white-space:pre-wrap;background-color:rgb(245,245,245);font-family:Consolas,Monaco,"Liberation Mono","Lucida Console",monospace;font-size:11.7px;margin-bottom:10px;overflow:auto;padding-left:5px;padding-top:5px;width:580px;color:rgb(0,0,0)"><code style="font-family:Consolas,Monaco,"Liberation Mono","Lucida Console",monospace;font-size:10.53px"><br></code></pre><pre style="white-space:pre-wrap;background-color:rgb(245,245,245);font-family:Consolas,Monaco,"Liberation Mono","Lucida Console",monospace;font-size:11.7px;margin-bottom:10px;overflow:auto;padding-left:5px;padding-top:5px;width:580px;color:rgb(0,0,0)"><code style="font-family:Consolas,Monaco,"Liberation Mono","Lucida Console",monospace;font-size:10.53px">Thanks and Regards,</code></pre><pre style="white-space:pre-wrap;background-color:rgb(245,245,245);font-family:Consolas,Monaco,"Liberation Mono","Lucida Console",monospace;font-size:11.7px;margin-bottom:10px;overflow:auto;padding-left:5px;padding-top:5px;width:580px;color:rgb(0,0,0)"><code style="font-family:Consolas,Monaco,"Liberation Mono","Lucida Console",monospace;font-size:10.53px">Bateesh</code></pre></div>