「g++をUbuntuへインストールする」の版間の差分
提供: C++入門
| 行4: | 行4: | ||
== 概要 == | == 概要 == | ||
| − | + | [[g++]]は、GNU GCCの[[C++コンパイラ]]です。 | |
== インストール == | == インストール == | ||
{{apt|gcc}} | {{apt|gcc}} | ||
| − | + | == g++パッケージを検索する == | |
| + | apt-cacheでg++のパッケージを検索できます。 | ||
| + | <syntaxhighlight lang="bash"> | ||
| + | $ apt-cache search 'g++'|grep ^g++ | ||
| + | g++ - GNU C++ compiler | ||
| + | g++-4.4 - GNU C++ compiler | ||
| + | g++-4.5 - GNU C++ compiler | ||
| + | g++-4.6 - GNU C++ compiler | ||
| + | g++-4.6-multilib - GNU C++ compiler (multilib files) | ||
| + | g++-multilib - GNU C++ compiler (multilib files) | ||
| + | g++-4.4-arm-linux-gnueabi - GNU C++ compiler | ||
| + | g++-4.4-arm-linux-gnueabihf - GNU C++ compiler | ||
| + | g++-4.4-multilib - GNU C++ compiler (multilib files) | ||
| + | g++-4.5-arm-linux-gnueabi - GNU C++ compiler | ||
| + | g++-4.5-arm-linux-gnueabihf - GNU C++ compiler | ||
| + | g++-4.5-multilib - GNU C++ compiler (multilib files) | ||
| + | g++-4.6-arm-linux-gnueabi - GNU C++ compiler | ||
| + | g++-4.6-arm-linux-gnueabihf - GNU C++ compiler | ||
| + | g++-4.6-multilib-arm-linux-gnueabi - GNU C++ compiler (multilib files) | ||
| + | g++-4.6-multilib-arm-linux-gnueabihf - GNU C++ compiler (multilib files) | ||
| + | g++-arm-linux-gnueabi - The GNU C++ compiler for armel architecture | ||
| + | g++-arm-linux-gnueabihf - The GNU C++ compiler for armhf architecture | ||
| + | g++-mingw-w64 - GNU C++ compiler for MinGW-w64 | ||
| + | g++-mingw-w64-i686 - GNU C++ compiler for MinGW-w64 targeting Win32 | ||
| + | g++-mingw-w64-x86-64 - GNU C++ compiler for MinGW-w64 targeting Win64 | ||
| + | </syntaxhighlight> | ||
| + | == バージョン == | ||
| + | <syntaxhighlight lang="bash"> | ||
| + | $ g++ --version | ||
| + | g++ (Ubuntu/Linaro 4.6.3-1ubuntu5) 4.6.3 | ||
| + | Copyright (C) 2011 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. | ||
| + | </syntaxhighlight> | ||
| + | == ヘッダファイル == | ||
| + | g++ 4.6 の場合、ヘッダファイルは、 /usr/include/c++/4.6 に入ります。 | ||
| + | <syntaxhighlight lang="bash"> | ||
| + | $ ls /usr/include/c++/4.6 | ||
| + | algorithm future | ||
| + | array i686-linux-gnu/ | ||
| + | atomic initializer_list | ||
| + | backward/ iomanip | ||
| + | bits/ ios | ||
| + | bitset iosfwd | ||
| + | cassert iostream | ||
| + | ccomplex istream | ||
| + | cctype iterator | ||
| + | cerrno limits | ||
| + | cfenv list | ||
| + | cfloat locale | ||
| + | chrono map | ||
| + | cinttypes memory | ||
| + | ciso646 mutex | ||
| + | climits new | ||
| + | clocale numeric | ||
| + | cmath ostream | ||
| + | complex parallel/ | ||
| + | complex.h profile/ | ||
| + | condition_variable queue | ||
| + | csetjmp random | ||
| + | csignal ratio | ||
| + | cstdarg regex | ||
| + | cstdbool set | ||
| + | cstddef sstream | ||
| + | cstdint stack | ||
| + | cstdio stdexcept | ||
| + | cstdlib streambuf | ||
| + | cstring string | ||
| + | ctgmath system_error | ||
| + | ctime tgmath.h | ||
| + | cwchar thread | ||
| + | cwctype tr1/ | ||
| + | cxxabi.h tuple | ||
| + | debug/ type_traits | ||
| + | decimal/ typeindex | ||
| + | deque typeinfo | ||
| + | exception unordered_map | ||
| + | ext/ unordered_set | ||
| + | fenv.h utility | ||
| + | forward_list valarray | ||
| + | fstream vector | ||
| + | functional | ||
| + | </syntaxhighlight> | ||
== 関連項目 == | == 関連項目 == | ||
{{g++}} | {{g++}} | ||
<!-- vim: filetype=mediawiki | <!-- vim: filetype=mediawiki | ||
--> | --> | ||
2014年4月6日 (日) 13:16時点における版
GNU GCCコンパイラコレクションC++コンパイラであるg++をUbuntuにインストールする方法です。
概要
インストール
Ubuntu/Debianにインストールする場合
apt コマンドでインストールする場合です。
sudo apt install gcc
g++パッケージを検索する
apt-cacheでg++のパッケージを検索できます。
$ apt-cache search 'g++'|grep ^g++ g++ - GNU C++ compiler g++-4.4 - GNU C++ compiler g++-4.5 - GNU C++ compiler g++-4.6 - GNU C++ compiler g++-4.6-multilib - GNU C++ compiler (multilib files) g++-multilib - GNU C++ compiler (multilib files) g++-4.4-arm-linux-gnueabi - GNU C++ compiler g++-4.4-arm-linux-gnueabihf - GNU C++ compiler g++-4.4-multilib - GNU C++ compiler (multilib files) g++-4.5-arm-linux-gnueabi - GNU C++ compiler g++-4.5-arm-linux-gnueabihf - GNU C++ compiler g++-4.5-multilib - GNU C++ compiler (multilib files) g++-4.6-arm-linux-gnueabi - GNU C++ compiler g++-4.6-arm-linux-gnueabihf - GNU C++ compiler g++-4.6-multilib-arm-linux-gnueabi - GNU C++ compiler (multilib files) g++-4.6-multilib-arm-linux-gnueabihf - GNU C++ compiler (multilib files) g++-arm-linux-gnueabi - The GNU C++ compiler for armel architecture g++-arm-linux-gnueabihf - The GNU C++ compiler for armhf architecture g++-mingw-w64 - GNU C++ compiler for MinGW-w64 g++-mingw-w64-i686 - GNU C++ compiler for MinGW-w64 targeting Win32 g++-mingw-w64-x86-64 - GNU C++ compiler for MinGW-w64 targeting Win64
バージョン
$ g++ --version g++ (Ubuntu/Linaro 4.6.3-1ubuntu5) 4.6.3 Copyright (C) 2011 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.
ヘッダファイル
g++ 4.6 の場合、ヘッダファイルは、 /usr/include/c++/4.6 に入ります。
$ ls /usr/include/c++/4.6 algorithm future array i686-linux-gnu/ atomic initializer_list backward/ iomanip bits/ ios bitset iosfwd cassert iostream ccomplex istream cctype iterator cerrno limits cfenv list cfloat locale chrono map cinttypes memory ciso646 mutex climits new clocale numeric cmath ostream complex parallel/ complex.h profile/ condition_variable queue csetjmp random csignal ratio cstdarg regex cstdbool set cstddef sstream cstdint stack cstdio stdexcept cstdlib streambuf cstring string ctgmath system_error ctime tgmath.h cwchar thread cwctype tr1/ cxxabi.h tuple debug/ type_traits decimal/ typeindex deque typeinfo exception unordered_map ext/ unordered_set fenv.h utility forward_list valarray fstream vector functional