Use CreateDirectoryA instead. CreateDirectory is a macro that expands to either CreateDirectoryA or CreateDirectoryW depending on the build configuration; They take respectively LPCSTR and LPCWSTR. If you know you have a LPCSTR (which is what c_str() gives you), use the first one.