在 Visual Studio 中安裝 c + + 支援Install C++ support in Visual Studio

如果您還沒有下載並安裝 Visual Studio 2017 和 Visual c + + 工具,以下是如何開始使用。If you haven't downloaded and installed Visual Studio 2017 and the Visual C++ tools yet, here's how to get started.

必要條件Prerequisites

  • 寬頻網際網路連線。A broadband internet connection. Visual Studio 安裝程式可以下載好幾 gb 的資料。The Visual Studio installer can download several gigabytes of data.

  • 執行 Microsoft Windows 7 或更新版本的電腦。A computer that runs Microsoft Windows 7 or later versions. 我們建議的最佳開發體驗的 Windows 10。We recommend Windows 10 for the best development experience. 請確定您安裝 Visual Studio 之前,將最新的更新會套用到您的系統。Make sure that the latest updates are applied to your system before you install Visual Studio.

  • 足夠的可用磁碟空間。Enough free disk space. Visual Studio 至少需要 7 GB 的磁碟空間,而可能需要 50 GB 或更多如果安裝了許多常見的選項。Visual Studio requires at least 7GB of disk space, and can take 50GB or more if many common options are installed. 我們建議您將它安裝在您的 c: 磁碟機。We recommend you install it on your C: drive.

如需磁碟空間和作業系統需求的詳細資訊,請參閱Visual Studio 產品系列系統需求For details on the disk space and operating system requirements, see Visual Studio Product Family System Requirements. 安裝程式會報告您選取的選項需要多少磁碟空間。The installer reports how much disk space is required for the options you select.

Visual Studio 2015 安裝Visual Studio 2015 Installation

若要安裝 Visual Studio 2015,請前往下載舊版 Visual StudioTo install Visual Studio 2015, go to Download older versions of Visual Studio. 執行安裝程式,並選擇 [自訂安裝],然後選擇 C++ 元件。Run the setup program and choose Custom installation and then choose the C++ component. C + + 支援新增至現有的 Visual Studio 2015 安裝,按一下 Windows [開始] 按鈕並鍵入新增或移除程式To add C++ support to an existing Visual Studio 2015 installation, click on the Windows Start button and type Add Remove Programs. 從結果清單中開啟的程式,然後尋找 Visual Studio 2015 安裝在已安裝的程式清單中。Open the program from the results list and then find your Visual Studio 2015 installation in the list of installed programs. 連按兩下,然後選擇修改,然後選取要安裝的 Visual c + + 元件。Double-click it, then choose Modify and select the Visual C++ components to install.

一般來說,即使需要使用 Visual Studio 2015 編譯器,編譯您的程式碼,也都非常建議您使用 Visual Studio 2017。In general, we highly recommend that you use Visual Studio 2017 even if you need to compile your code using the Visual Studio 2015 compiler. 如需詳細資訊,請參閱在 Visual Studio 中使用原生多目標來建置舊專案For more information, see Use native multi-targeting in Visual Studio to build old projects.

Visual Studio 2017 安裝Visual Studio 2017 Installation

  1. 下載最新的 Visual Studio 2017 安裝程式的 Windows。Download the latest Visual Studio 2017 installer for Windows.

    提示

    Community Edition 是針對個別開發人員、課堂學習、學術研究和開放原始碼開發。The Community edition is for individual developers, classroom learning, academic research, and open source development. 針對其他用途,請安裝 Visual Studio 2017 ProfessionalVisual Studio 2017 EnterpriseFor other uses, install Visual Studio 2017 Professional or Visual Studio 2017 Enterprise.

  2. 尋找您已下載並執行它的安裝程式檔案。Find the installer file you downloaded and run it. 它可能會顯示在瀏覽器中,或您可能會發現您的 [下載] 資料夾中。It may be displayed in your browser, or you may find it in your Downloads folder. 安裝程式需要系統管理員權限,才能執行。The installer needs Administrator privileges to run. 您可能會看到使用者帳戶控制詢問是否要授與權限,讓安裝程式對您的系統進行變更; 選擇的對話方塊You may see a User Account Control dialog asking you to give permission to let the installer make changes to your system; choose Yes. 如果您遇到問題,在檔案總管中尋找下載的檔案,以滑鼠右鍵按一下 [安裝程式] 圖示,然後選擇系統管理員身分執行從內容功能表。If you are having trouble, find the downloaded file in File Explorer, right-click on the installer icon, and choose Run as Administrator from the context menu.

    下載並安裝 Visual Studio InstallerDownload and install the Visual Studio Installer

  3. 安裝程式會顯示一份工作負載清單,而工作負載是特定開發區域的相關選項群組。The installer presents you with a list of workloads, which are groups of related options for specific development areas. C + + 的支援現在是選擇性並未預設安裝的工作負載的一部分。Support for C++ is now part of optional workloads that aren't installed by default.

    使用 c + + 工作負載的桌面開發Desktop development with C++ workload

    C + +,請選取使用 c + + 的桌面開發工作負載,然後選擇安裝For C++, select the Desktop development with C++ workload and then choose Install.

    安裝包含 c + + 工作負載的桌面開發Install the Desktop development with C++ workload

  4. 當安裝完成時,選擇啟動按鈕來啟動 Visual Studio。When the installation completes, choose the Launch button to start Visual Studio.

    第一次執行 Visual Studio 中,您必須使用 Microsoft 帳戶登入。The first time you run Visual Studio, you are asked to sign in with a Microsoft Account. 如果您沒有帳戶,您可以免費建立一個。If you don't have one, you can create one for free. 您也必須選擇一個佈景主題。You must also choose a theme. 別擔心,您可以將它變更稍後如果您想要。Don't worry, you can change it later if you want to.

    可能需要 Visual Studio 幾分鐘,您就準備好使用您在執行第一次。It may take Visual Studio several minutes to get ready for use the first time you run it. 以下是看起來像是快速縮時攝影外:Here's what it looks like in a quick time-lapse:

    登入的 visual Studio 2017Visual Studio 2017 sign in

    當您一次執行時,visual Studio 的啟動速度更快。Visual Studio starts much faster when you run it again.

  5. Visual Studio 開啟時,請查看標題列中的旗標圖示會反白顯示:When Visual Studio opens, check to see if the flag icon in the title bar is highlighted:

    Visual Studio 2017 通知 旗標Visual Studio 2017 notification flag

    如果會反白顯示,請選取它以開啟通知視窗。If it is highlighted, select it to open the Notifications window. 如果有適用於 Visual Studio 的任何更新,我們建議您立即安裝它們。If there are any updates available for Visual Studio, we recommend you install them now. 安裝完成之後,重新啟動 Visual Studio。Once the installation is complete, restart Visual Studio.

當 Visual Studio 執行時,您已準備好繼續進行下一個步驟。When Visual Studio is running, you are ready to continue to the next step.

後續步驟Next Steps