2

I have a c++ application written and compiled on a RedHat5 Linux machine using NetBeans. (c++ and gcc version 4.1.2)
I want to compile it on a RedHat7 machine (c++ and gcc version 4.8.5). My problem is that all functions related to the c++ std library are showing an error.

I tried changing the c++ compiler to c++98 and c++11 but both didn't work. All header includes remained the same.

// A simple split function that returns vector of double
std::vector<double> ConfigParser::split(std::string combined, char separator) {
    std::vector<double> separated;
    std::replace(combined.begin(), combined.end(), separator, ' ');
    std::stringstream ss(combined);
    std::string temp;
    while (ss >> temp)
    {
        separated.push_back(atof(temp.c_str()));
    }
    return separated;
}
ConfigParser.cpp:34:5: error: ‘replace’ is not a member of ‘std’

ConfigParser.cpp:39:46: error: ‘atof’ was not declared in this scope
Deduplicator
  • 44,692
  • 7
  • 66
  • 118
Hasan H
  • 142
  • 11
  • 1
    Are you including `algorithm` and `cstdlib` in this file? It might be that some other header did include them in the previous version. – VLL Aug 27 '19 at 11:25
  • Yes and it works but some includes will not work on the RHEL 5 version – Hasan H Aug 27 '19 at 12:51

0 Answers0