##聞きたいこと
タイトルの通りです。
C++でinclude <bits/stdc++.h>を使用可能にしようと思い、Qiitaにある記事を元にやってみました。
brewでインストールしたg++-7,gcc-7のパスがうまく通っていないようなので、
その通し方をご教授いただきたいです。
##試したこと
こちらの記事を参考にしました。
https://qiita.com/akameco/items/b081f05757eef4360108
とりあえずbrewでのインストール、シンボリックリンクは貼りました。
Terminal
1//ターミナルで実行したコマンド 2brew install gcc 3ln -s /usr/local/bin/gcc-7 /usr/local/bin/gcc 4ln -s /usr/local/bin/g++-7 /usr/local/bin/g++
##確かめたこと
- brewのインストールがうまく行われているか。
->/usr/local/Cellar/gcc/7.3.0/にきちんと入っていた。
ちなみに/usr/local/Cellar/gcc/7.3.0/include/c++/7.3.0/bits/にstdc++.hは無かった。
//
2. シンボリックリンクがうまく貼れているか。
/usr/local/bin/にg++,g++-7,gcc,gcc-7があったので貼れてはいると思う。
シンボリックリンクが腫れているかをどう確かめればいいのかわからないのでlsコマンドで確かめた。
//
3. g++およびgccの-vオプションで状態がどうなっているか。
以下、実行した時のターミナルです。
Terminal
1Username$ gcc -v 2Configured with: --prefix=/Applications/Xcode.app/Contents/Developer/usr --with-gxx-include-dir=/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.13.sdk/usr/include/c++/4.2.1 3Apple LLVM version 9.0.0 (clang-900.0.39.2) 4Target: x86_64-apple-darwin17.4.0 5Thread model: posix 6InstalledDir: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin
Terminal
1 2Username$ g++ -v 3Configured with: --prefix=/Applications/Xcode.app/Contents/Developer/usr --with-gxx-include-dir=/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.13.sdk/usr/include/c++/4.2.1 4Apple LLVM version 9.0.0 (clang-900.0.39.2) 5Target: x86_64-apple-darwin17.4.0 6Thread model: posix 7InstalledDir: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin
##実行環境
MacOSX High Sierra 10.13.3
Xcode version 9.2
回答1件
あなたの回答
tips
プレビュー