![]() Here, it is trying to compile using C++98 as seen in the error. The snippets are correct and have been tested with online compilers using C++11. Some_program.cpp:12:33: error: in C++98 'A' must be initialized by constructor, not by '' So you can either install and setup a version of the GCC compiler for Windows (look into MinGW-w64, TDM-GCC, or MinGW), or you will need to configure the Code Runner to use the MSVC compiler instead. Some_program.cpp: In function 'int main()': GCC is a different compiler (from the MSVC compiler), and apparently the Code Runner uses it by default. Please help me out if there are alternate ways to get my program compiled. I wish I could tweak some setting in Visual Studio Code and change the compiler command from g++ to g++ -std=c++11 so that I could compile programs by just hitting the run code button. C++ programming with Visual Studio 2022How to compile your C++ code in Visual Studio 2022How to Create a C++ GUI Application Using Visual Studio 2022how to d. ![]() I am aware that using g++ -std=c++11, we can compile C++11 programs using g++ and it works fine when I use it in my cmd as: When I try compiling C++11 programs, the compiler command g++ tries to compile it using default C++98 Standard and this results in errors. However, I am facing difficulty in compiling c++11 programs using it. ![]() I'm using Visual Studio Code to compile C++ programs and it works for most C++ programs as it compiles it using g++ command.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |