Reputation: 73
I'm having trouble getting my code to compile. I want to use std::to_string as it is a convenient one liner for converting an int into a string. However, I keep getting " 'to_string' is not a member of 'std' ", so this seems to be a compiler problem as this should be a standard capability in later C++ versions.
The first time it failed to compile, I did some research and based on my findings I tried the following:
Including the following headers:
#include <iostream>
#include <string>
#include <sstream>
Trying to compile in C++ 11, 17, and 20
Changing intellisense mode between msvc-x64 and gcc-x64
Changing intellisense engine between "Default" and "Tag Parser"
None of these seem to rectify the problem. I don't know what else to try. Any insight would be appreciated.
Upvotes: 4
Views: 3447
Reputation: 143
Change C++ standard version to C++11 (minimal, by default it's C++98). You may also check Compiler path: it's clang by default.
You can change it in the C/C++ configuration UI by running the command C/C++: Edit Configurations (UI) from the Command Palette (Ctrl+Shift+P).
Upvotes: 2