Do you really need the string() around "://" etc? concatenating const char* with string should be possible. Especially "string(user)" and "string(pass)" don't make sense as "user" and "pass" already are of type string.