Answer the question
In order to leave comments, you need to log in
Why don't CLANG/GCC compile code that MSVC++ compiles?
CLANG/GCC do not see the string type in the global namespace if it is loaded there via using std::string (they only see if ::string is written instead of string), they also require . I didn't think they had different standards. How can I not step on such a rake?
Answer the question
In order to leave comments, you need to log in
Потому, что gcc - компилятор языка C. Используйте g++.
Ошибку выбивает потому, что вы не подключили библиотеку libstdc++, в которой определены string и другие объекты стандартной библиотеки:
Просто, msvc++
и g++
делают это автоматически.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question