mac 查看C++及各种环境的命令

MacBook-Air:$ which g++
/usr/bin/g++
MacBook-Air:$ arch
i386
MacBook-Air:$ g++ --version
Configured with: --prefix=/Library/Developer/CommandLineTools/usr --with-gxx-include-dir=/usr/include/c++/4.2.1
Apple LLVM version 7.3.0 (clang-703.0.31)
Target: x86_64-apple-darwin15.6.0
Thread model: posix
InstalledDir: /Library/Developer/CommandLineTools/usr/bin
MacBook-Air:$ gcc --version
Configured with: --prefix=/Library/Developer/CommandLineTools/usr --with-gxx-include-dir=/usr/include/c++/4.2.1
Apple LLVM version 7.3.0 (clang-703.0.31)
Target: x86_64-apple-darwin15.6.0
Thread model: posix
InstalledDir: /Library/Developer/CommandLineTools/usr/bin
MacBook-Air:$ clang++ --version
Apple LLVM version 7.3.0 (clang-703.0.31)
Target: x86_64-apple-darwin15.6.0
Thread model: posix
InstalledDir: /Library/Developer/CommandLineTools/usr/bin
MacBook-Air:$ brew --config
^[[B^[[B^[[B^[[BHOMEBREW_VERSION: 0.9.9
ORIGIN: https://github.com/Homebrew/brew
HEAD: cc10c632a8c2803b7e62a37c9490beca8fb48128
Last commit: 3 months ago
Core tap ORIGIN: https://github.com/Homebrew/homebrew-core
Core tap HEAD: 94bfaedfec6c0c6e6434fd147956aa2478dffd1d
Core tap last commit: 3 months ago
HOMEBREW_PREFIX: /usr/local
HOMEBREW_REPOSITORY: /usr/local
HOMEBREW_CELLAR: /usr/local/Cellar
HOMEBREW_BOTTLE_DOMAIN: https://homebrew.bintray.com
CPU: quad-core 64-bit broadwell
Clang: 7.3 build 703
Perl: /usr/bin/perl
Python: /usr/bin/python
Ruby: /usr/bin/ruby => /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/bin/ruby
Java: 1.8.0_60, 1.6.0_65-b14-468
System Ruby: 2.0.0-p648
OS X: 10.11.6-x86_64
Xcode: N/A
CLT: 7.3.1.0.1.1461711523
X11: N/A

转载于:https://www.cnblogs.com/Kellana/p/5848934.html

Mac环境下配置C++编程环境,您可以按照以下步骤进行操作: 1. 首先,您需要安装GNU的C/C++编译器。在UNIX/Linux系统上,您可以使用以下命令安装gcc编译器: ``` sudo apt-get install gcc ``` 2. 接下来,您可以创建一个简单的C++程序文件,比如将以下代码保存在名为helloworld.cpp的文件中: ```cpp #include <iostream> using namespace std; int main() { cout << "Hello, world!" << endl; return 0; } ``` 3. 然后,您可以使用以下命令编译和运行该程序: ``` g++ helloworld.cpp -o helloworld ./helloworld ``` 这样,您就可以在Mac环境下配置并运行C++程序了。请注意,这只是一个简单的示例,您可以根据自己的需求进行更复杂的C++编程。希望对您有所帮助!\[1\]\[2\] #### 引用[.reference_title] - *1* *2* [c++环境配置](https://blog.csdn.net/ikun_not_250/article/details/127981028)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v91^insertT0,239^v3^insert_chatgpt"}} ] [.reference_item] - *3* [【MAC】vscode C++环境配置学习以及问题解决](https://blog.csdn.net/print_gqh/article/details/126190696)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v91^insertT0,239^v3^insert_chatgpt"}} ] [.reference_item] [ .reference_list ]
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值