问题
I am using CodeLite 5.1 on Ubuntu QQ. By default, based on what was intalled previously with QQ and other tools, I have the gtCC and gt++ toolchains avialable. I always use gt++, which seems to get along OK with Boost.
Would like to get things running using C++ 11 - what steps do I need to take? Do I need to install C++ 11 libs?
回答1:
Update See below
I tried on Linux1:
First, under build options, create an entry for the relevant compiler switch:
Zoomed:
Demonstration using g++:
- Create project
- Set build flags (Global Settings)
- Build and run
SUCCESS!
Update:
You will likely want to tick the Enable C++11 Standard checkbox under "Code Completion" too:
1 On Ubuntu Quantal, don't use the distro version - it crashes on opening a project. Use
deb http://repos.codelite.org/ubuntu/ quantal universe
回答2:
You need to supply a -std=c++11
(or similar) command to the compiler you are using. Consult the documentation of your compiler of choice.
Unless you current code is subject to breaking changes that were introduced with C++11, your current code will continue to run "as is". Verify that all your test continue to run, and then you are all set to start using the new features that your compiler supports. Since C++11 support is very much in flux, you might have to upgrade your compiler to its lastest version.
来源:https://stackoverflow.com/questions/16172050/how-to-migrate-to-c-11-in-an-opensource-ide-codelite