james007 发表于 2020-4-29 14:10:55

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

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

simonzhd 发表于 2020-4-29 14:59:48

我在用iMac,但只会配PHP的运行环境,爱莫能助啦

james007 发表于 2020-4-29 15:51:49

simonzhd 发表于 2020-4-29 14:59
我在用iMac,但只会配PHP的运行环境,爱莫能助啦

嗯,PHP是开发网站的吗?

孤独星球 发表于 2020-4-29 16:21:54


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

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.


你可能需要翻译……

孤独星球 发表于 2020-4-29 16:26:07

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

simonzhd 发表于 2020-4-29 16:47:25

james007 发表于 2020-4-29 15:51
嗯,PHP是开发网站的吗?

是的

james007 发表于 2020-4-29 18:12:34

我有谷歌翻译,谢谢孤独星球

孤独星球 发表于 2020-4-29 21:17:27

james007 发表于 2020-4-29 18:12
我有谷歌翻译,谢谢孤独星球

不必客气,努力学习C语言!

james007 发表于 2020-4-30 09:47:08

我装了个扩展插件,名字叫code runner,可以单文件调试,运行,很好用

legs+ 发表于 2020-9-5 23:35:23

vscode是一个特别特别优秀的ide而且开源,但是你说用来写c我感觉你还是高估它了,它最适合写JavaScript和Python
页: [1] 2
查看完整版本: 怎样设置Mac版vscode的C/C++编译环境呢?