This question already has answers here:
Compilation error with "for each" loop in C++ VS2010
(6 answers)
Closed 7 years ago.
I'm trying to compile my old Qt project on another system: Windows XP, Qt5, msvc 2010.
I used c++11 auto in my project, there is a line CONFIG += c++11 in the pro file.
for(auto e : mapTerm->keys())
{
mapTerm->insert(e, attrib.value(e).toString());
}
Now it cannot recognize the auto loop and gives me syntax errors.
You'll need to ensure that you are using the propper C++ compiler and that it is C++11+.
If you are using msvc and are using the correct version then this should be a built in feature.
Related
This question already has answers here:
How to change C++ version being used by VS Code?
(2 answers)
How to enable C++17 support in VSCode C++ Extension
(8 answers)
How to Setup VS Code For C++ 14 /C ++17
(5 answers)
Closed 6 months ago.
Hello have just started programming c++ but realized by default version of C++ is 98 on my vscode. I have tried changing the cpp Standard field to c++17 also went into tasks.json to change the flag in args however am very confused why my version is still c++98?
This question already has answers here:
How to install older version of GCC on Windows 10
(3 answers)
Closed 2 years ago.
I am new to coding in C++ and I am not sure where I can compile a C++ program, I am learning C++ through a website that already has a place to compile the code built into it. I know how to compile a program by using these commands: g++ [program name].cpp -o [name you want to give] and then do ./[name you gave]. I want to know where I can compile my code outside of this website.
Thanks.
There are lots of places you can write code for c++. Usually people will use IDEs such as
Visual Studio Code
Code::Blocks
CLion
Eclipse
CodeLite
etc...
This question already has answers here:
How can I add C++11 support to Code::Blocks compiler?
(4 answers)
Closed 3 years ago.
Recently I have tried to use some Advance c++ functions in CodeBlocks but all the time it throw errors like " according to c++ 98....... ".
If CodeBlocks uses an old version of c++ can I update it to c++11 or c++14.
I am just a new learner and cordially requesting you to help if you know the answer.
You can set compiler version and language standart in settings.
See this How can I add C++11 support to Code::Blocks compiler?
This question already has answers here:
How to configure Xcode to compile not supported language, e.g. Fortran?
(1 answer)
Intel Fortran Compiler in XCode 8.3.2
(1 answer)
Closed 10 months ago.
I'm trying to use Intel c++ compiler for my Xcode project. After installation, following the tutorial from Intel, there's an Intel c++ compiler should be available on the build list in Xcode. However, my Xcode only lists the default compiler. Could anyone explain how to add addition compiler to Xcode?
Thx
This question already has answers here:
How to enable C++11 in Qt Creator?
(6 answers)
Closed 7 years ago.
I'm using Qt Creator on Ubuntu, and I'd like to use the new C++11 features, however they are not enabled by default.
How can I configure Qt Creator to support the new C++11 features?
You can achieve this by adding:
QMAKE_CXXFLAGS += -std=c++11
to your .pro file.