Q:

error strlen not a member of std only on linux not on solaris

below code compiles on Solaris using Sun Studio but on linux using gcc it says strlen is not a member of std.
inline std::string pathname(char const *p)
{
    std::string pname;
    std::transform(p, p+std::strlen(p), std::back_inserter(pname), platform::switch_slash);
    return pname;
}

Thanks

A:

You need to include the cstring header to get std::strlen:
#include <cstring>

