문제

When I run g++ --version on in my Cloud9 terminal I get g++ (GCC) 4.4.7 20120313 (Red Hat 4.4.7-3). This is a fairly old version - old enough that when I try to use C++11 library features like std::unordered_set, I get: "This file requires compiler and library support for the upcoming ISO C++ standard, C++0x. This support is currently experimental, and must be enabled with the -std=c++0x or -std=gnu++0x compiler options."

I'm not really okay with this, because I don't like having to worry about what features I'm allowed to use and which ones I need to avoid. So I went looking around for how to update g++ to the latest stable version (which seems to be 4.8.1 as of this writing), but I can't figure out how to do it. I tried apt-get, but I just got an error: "Sorry, apt-get is not supported on this system. Try c9pm instead.". Well I tried that, but c9pm list (which is supposed to "List available packages") doesn't show anything that looks like g++. So I'm lost.

How do I install g++ 4.8.1 on Cloud9?


When I run lsb_release -a I see that Cloud9 IDE currently runs on "Red Hat Enterprise Linux Server release 6.4 (Santiago)".

도움이 되었습니까?

해결책 2

This is no longer a problem. g++ --version now returns g++ (Ubuntu 4.8.2-19ubuntu1) 4.8.2 which, to my knowledge, has full support for C++11.

다른 팁

If you choose C/C++ as the project type for a new project you will get a newer gcc version (currently 4.7.2). If you need an even newer one let us know and we can update that version. You can always try to compile the tools you need on the workspace but in case of gcc this might take ages.

Actually, cloud9 gives you 4.8.2

cpp --version cpp (Ubuntu 4.8.2-19ubuntu1) 4.8.2 Copyright (C) 2013 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top