gcc에서 컴파일되지 않는 이유는 무엇입니까?libstdC++에서 std :: to_wstring을 사용 하시겠습니까?
#include <iostream>
#include <string>
int main() {
double f = 23.43;
std::wstring f_str = std::to_wstring(f);
std::wcout << f_str << std::endl;
return 0;
}
오류 :
prog.cpp: In function ‘int main()’:
prog.cpp:6:26: error: ‘to_wstring’ is not a member of ‘std’
어떤 버전의 GCC와 libstdC++를 사용하고 있습니까? –
'-std = C++ 11'을 사용하고'__GXX_EXPERIMENTAL_CXX0X__'을 정의하고 있습니까? – antonijn
@Antonijn, 당신은'__GCC_EXPERIMENTAL_CXX0X__'을 정의해서는 안되며, 컴파일러에 맡겨 두지 마십시오. 그러지 마. –