美丽心灵公益论坛

查看: 4450|回复: 11

怎样设置Mac版vscode的C/C++编译环境呢?

[复制链接]
累计签到:24 天
连续签到:1 天

271

主题

1224

回帖

211万

积分

版主

Rank: 7Rank: 7Rank: 7

积分
2113409
james007 发表于 2020-4-29 14:10:55| 字数 89 | 显示全部楼层 |阅读模式

马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。

您需要 登录 才可以下载或查看,没有账号?立即注册

x
2016年,我病情波动的时候,买了这个Macbook Air 乞丐版,现在拿出来用了,在学c,在网上找了很多关于vscode编译环境设置教程,但是都没成功,不知道怎么搞,有人会搞吗?
人生如棋,人如棋子
累计签到:1464 天
连续签到:6 天

521

主题

6317

回帖

519万

积分

管理员

Rank: 9Rank: 9Rank: 9

积分
5198312

活跃会员热心会员发帖达人最佳新人

活跃会员
simonzhd 发表于 2020-4-29 14:59:48| 字数 26 | 显示全部楼层
我在用iMac,但只会配PHP的运行环境,爱莫能助啦
累计签到:24 天
连续签到:1 天

271

主题

1224

回帖

211万

积分

版主

Rank: 7Rank: 7Rank: 7

积分
2113409
 楼主| james007 发表于 2020-4-29 15:51:49| 字数 64 | 显示全部楼层
simonzhd 发表于 2020-4-29 14:59
我在用iMac,但只会配PHP的运行环境,爱莫能助啦

嗯,PHP是开发网站的吗?
人生如棋,人如棋子

尚未签到

62

主题

405

回帖

1272

积分

金牌会员

Rank: 6Rank: 6

积分
1272

活跃会员发帖达人

活跃会员
孤独星球 发表于 2020-4-29 16:21:54| 字数 738 | 显示全部楼层

我从微软网站很快就找到这个:

https://code.visualstudio.com/docs/setup/mac


Installation
  • Download Visual Studio Code for macOS.
  • Open the browser's download list and locate the downloaded archive.
  • Select the 'magnifying glass' icon to open the archive in Finder.
  • Drag Visual Studio Code.app to the Applications folder, making it available in the macOS Launchpad.
  • Add VS Code to your Dock by right-clicking on the icon to bring up the context menu and choosing Options, Keep in Dock.


Launching from the command line
You can also run VS Code from the terminal by typing 'code' after adding it to the path:
  • Launch VS Code.
  • Open the Command Palette (F1) and type 'shell command' to find the Shell Command: Install 'code' command in PATH command.
  • Restart the terminal for the new $PATH value to take effect. You'll be able to type 'code .' in any folder to start editing files in that folder.


你可能需要翻译……
香港作家孙淡宁在《水车集》里说:“钱可以买到‘药物’,但买不到‘健康’;钱可以买到‘美食’,但买不到‘食欲’;钱可以买到‘床’,但买不到‘睡眠’……

尚未签到

62

主题

405

回帖

1272

积分

金牌会员

Rank: 6Rank: 6

积分
1272

活跃会员发帖达人

活跃会员
孤独星球 发表于 2020-4-29 16:26:07| 字数 881 | 显示全部楼层
https://code.visualstudio.com/docs/cpp/config-clang-mac

In this tutorial, you configure Visual Studio Code on macOS to use the Clang/LLVM compiler and debugger.
After configuring VS Code, you will compile and debug a simple C++ program in VS Code. This tutorial does not teach you about Clang or the C++ language. For those subjects, there are many good resources available on the Web.
If you have any trouble, feel free to file an issue for this tutorial in the VS Code documentation repository.
Prerequisites
To successfully complete this tutorial, you must do the following:
  • Install Visual Studio Code on macOS.
  • Install the C++ extension for VS Code. You can install the C/C++ extension by searching for 'c++' in the Extensions view (Ctrl+Shift+X).


Ensure Clang is installed
Clang may already be installed on your Mac. To verify that it is, open a macOS Terminal window and enter the following command:
clang --version

If Clang isn't installed, enter the following command to install the command line developer tools:
xcode-select --install
香港作家孙淡宁在《水车集》里说:“钱可以买到‘药物’,但买不到‘健康’;钱可以买到‘美食’,但买不到‘食欲’;钱可以买到‘床’,但买不到‘睡眠’……
累计签到:1464 天
连续签到:6 天

521

主题

6317

回帖

519万

积分

管理员

Rank: 9Rank: 9Rank: 9

积分
5198312

活跃会员热心会员发帖达人最佳新人

活跃会员
simonzhd 发表于 2020-4-29 16:47:25| 字数 40 | 显示全部楼层
james007 发表于 2020-4-29 15:51
嗯,PHP是开发网站的吗?

是的
累计签到:24 天
连续签到:1 天

271

主题

1224

回帖

211万

积分

版主

Rank: 7Rank: 7Rank: 7

积分
2113409
 楼主| james007 发表于 2020-4-29 18:12:34| 字数 13 | 显示全部楼层
我有谷歌翻译,谢谢孤独星球
人生如棋,人如棋子

尚未签到

62

主题

405

回帖

1272

积分

金牌会员

Rank: 6Rank: 6

积分
1272

活跃会员发帖达人

活跃会员
孤独星球 发表于 2020-4-29 21:17:27| 字数 51 | 显示全部楼层
james007 发表于 2020-4-29 18:12
我有谷歌翻译,谢谢孤独星球

不必客气,努力学习C语言!
香港作家孙淡宁在《水车集》里说:“钱可以买到‘药物’,但买不到‘健康’;钱可以买到‘美食’,但买不到‘食欲’;钱可以买到‘床’,但买不到‘睡眠’……
累计签到:24 天
连续签到:1 天

271

主题

1224

回帖

211万

积分

版主

Rank: 7Rank: 7Rank: 7

积分
2113409
 楼主| james007 发表于 2020-4-30 09:47:08| 字数 37 | 显示全部楼层
我装了个扩展插件,名字叫code runner,可以单文件调试,运行,很好用
人生如棋,人如棋子
累计签到:534 天
连续签到:1 天

887

主题

3119

回帖

4万

积分

版主

Rank: 7Rank: 7Rank: 7

积分
48414
legs+ 发表于 2020-9-5 23:35:23| 字数 65 | 显示全部楼层
vscode是一个特别特别优秀的ide而且开源,但是你说用来写c我感觉你还是高估它了,它最适合写JavaScript和Python
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

Archiver|手机版|小黑屋|免责及版权声明|关于|美丽心灵公益论坛

GMT+8, 2025-8-13 14:10 , Processed in 0.065605 second(s), 31 queries .

Powered by Discuz! X3.4

!copyright!

快速回复 返回顶部 返回列表