How to migrate to C++ 11 in an OpenSource IDE (codelite) [closed]

一曲冷凌霜 提交于 2019-12-04 05:09:33

问题


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++:

  1. Create project

  1. Set build flags (Global Settings)

  1. 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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!