Development Tip

Visual Studio없이 Visual C ++ 명령 줄 컴파일러를 다운로드 할 수 있습니까?

yourdevel 2020. 12. 5. 10:48
반응형

Visual Studio없이 Visual C ++ 명령 줄 컴파일러를 다운로드 할 수 있습니까?


제목에 따라. 전체 Visual C ++ 설치 프로그램을 다운로드하지 않고 "cl.exe"와 Windows에서 C ++ 프로그램을 컴파일하고 링크하는 데 필요한 기타 프로그램 만 다운로드하고 싶습니다.


2014 년에는 Microsoft에서 Visual C ++ 컴파일러 만 다운로드 할 수 없었습니다.

예전에는 당신이 할 수있었습니다. 그런 다음 플랫폼 SDK에서 가져올 수있었습니다. 그런 다음 Visual Studio를 설치해야만 얻을 수 있습니다.

다행히 그 당시 데스크톱 용 Visual Studio Express (당시 Visual Studio의 무료 버전)와 함께 번들로 제공되는 컴파일러는 Professional 또는 Universal 버전에서 제공하는 것과 동일했습니다.

2015 년 11 월 Microsoft는 Visual C ++ Build Tools 라는 독립 패키지로 컴파일러 도구를 다시 제공하기 시작했습니다 .

Microsoft는 다음과 같이 씁니다.

C ++ 빌드 도구 설치 관리자는 Visual Studio 2015가 이미 설치된 컴퓨터에서 실행되지 않습니다. 그 반대 (즉, Visual Studio 로의 업그레이드)가 지원됩니다.

장기적인 상황은 언제나처럼 불분명합니다. 고지 사항 : 빌드 도구를 직접 사용하지 않았습니다. 먼저 Visual Studio를 제거해야합니다.


말했듯이 그렇게 할 방법이 없습니다. 전체 4-6GB + 번들을 다운로드해야합니다. MS 배포는 엉터리입니다.

그러나 실제로 모든 것을 설치할 필요는 없습니다 . 수동 설치가 필요한 경우 번들에서 개별 구성 요소를 추출하여보다 체계적인 디렉토리 트리에 모두 넣을 수 있습니다.

예를 들어 x86 환경에서 현재 MSVC2013 컴파일러를 사용하는 데 필요한 최소한의 설정은 다음과 같습니다.

  • vc_compilerCore86.msi: MSVC 툴체인;
  • vc_compilerCore86res.msi: MSVC 툴체인 MUI 리소스;
  • vc_librarycore86.msi: MSVC 라이브러리 항목;
  • vc_LibraryDesktopX86.msi: 더 많은 MSVC 라이브러리 항목;
  • Windows Software Development Kit for Windows Store Apps-x86_en-us.msi: 윈도우 SDK 파일 및 관련 도구 ( rc.exe, mt.exe, 등);
  • Windows Software Development Kit-x86_en-us.msi: 더 윈도우 SDK 파일 (특히 WinSock2.h, WS2_32.lib아마도 다른 사람).

다음을 실행하여 MSI 파일의 내용을 추출 할 수 있습니다 msiexec /a <msifile> TARGETDIR="<path>"( /quiet일괄 처리 하는 경우 매개 변수를 입력하십시오). 물론 번들 내의 MSI 파일을 조사하여 패키지에 더 많은 것을 넣을 수도 있습니다. 특히, 위의 세트에는 최신 MSBuild 도구가 누락되어 있습니다. 물건은 종종 여러 MSI 사이에 흩어져 있기 때문에 행운을 빕니다.

로컬 배포 용으로이 세트가 포함 된 50MB (!!!) 7z 파일이 있지만 Microsoft 라이선스 제한으로 인해 공개적으로 공유 할 수 없습니다.


최신 정보:

다음은 MSVC2015 도구, 헤더 및 라이브러리 용 MSI 파일 목록입니다.

packages\VisualC_D14\VC_Tools.Core\VC_Tools.Core.msi
packages\VisualC_D14\VC_Tools.Core.Res\VC_Tools.Core.Res.msi
packages\VisualC_D14\VC_Tools.X86.Base\VC_Tools.X86.Base.msi
packages\VisualC_D14\VC_Tools.X86.Base.Res\VC_Tools.X86.Base.Res.msi
packages\VisualC_D14\VC_Tools.X86.Nat\VC_Tools.X86.Nat.msi
packages\VisualC_D14\VC_Tools.X86.Nat.Res\VC_Tools.X86.Nat.Res.msi
packages\VisualC_D14\VC_Tools.X86.X64\VC_Tools.X86.X64.msi
packages\VisualC_D14\VC_Tools.X86.X64.Res\VC_Tools.X86.X64.Res.msi
packages\VisualC_D14\VC_PremTools.X86.Base\VC_PremTools.X86.Base.msi
packages\VisualC_D14\VC_PremTools.X86.Base.Res\VC_PremTools.X86.Base.Res.msi
packages\VisualC_D14\VC_PremTools.X86.Nat\VC_PremTools.X86.Nat.msi
packages\VisualC_D14\VC_PremTools.X86.Nat.Res\VC_PremTools.X86.Nat.Res.msi
packages\VisualC_D14\VC_PremTools.X86.X64\VC_PremTools.X86.X64.msi
packages\VisualC_D14\VC_PremTools.X86.X64.Res\VC_PremTools.X86.X64.Res.msi
packages\VisualC_D14\VC_CRT.Headers\VC_CRT.Headers.msi
packages\VisualC_D14\VC_CRT.X86.Desktop\VC_CRT.X86.Desktop.msi
packages\VisualC_D14\VC_CRT.X86.Store\VC_CRT.X86.Store.msi
packages\VisualC_D14\VC_CRT.X64.Desktop\VC_CRT.X64.Desktop.msi
packages\VisualC_D14\VC_CRT.X64.Store\VC_CRT.X64.Store.msi
packages\VisualC_D14\VC_CRT.Redist.Res\VC_CRT.Redist.Res.msi
packages\VisualC_D14\VC_CRT.Redist.X86\VC_CRT.Redist.X86.msi
packages\VisualC_D14\VC_CRT.Redist.X64\VC_CRT.Redist.X64.msi
packages\VisualC_D14\VC_ATL.Headers\VC_ATL.Headers.msi
packages\VisualC_D14\VC_ATL.X86\VC_ATL.X86.msi
packages\VisualC_D14\VC_ATL.X64\VC_ATL.X64.msi
packages\VisualC_D14\VC_MFC.Headers\VC_MFC.Headers.msi
packages\VisualC_D14\VC_MFC.X86\VC_MFC.X86.msi
packages\VisualC_D14\VC_MFC.X64\VC_MFC.X64.msi
packages\VisualC_D14\VC_PGO.Headers\VC_PGO.Headers.msi
packages\VisualC_D14\VC_PGO.X86\VC_PGO.X86.msi
packages\VisualC_D14\VC_PGO.X64\VC_PGO.X64.msi
packages\Win10_UniversalCRTSDK\Universal CRT Headers Libraries and Sources-x86_en-us.msi

다음은 WinSDK10 도구, 헤더 및 라이브러리 용 MSI 파일 목록입니다 (별도 다운로드).

Installers\Windows SDK Desktop Headers Libs Metadata-x86_en-us.msi
Installers\Windows SDK Desktop Tools-x86_en-us.msi
Installers\Windows SDK for Windows Store Apps Headers Libs-x86_en-us.msi
Installers\Windows SDK for Windows Store Apps Tools-x86_en-us.msi

All of this include stuff for both x86 and x64 (I haven't considered ARM or IA64). Both bundles compressed with LZMA will yield a 185MB file.


Update: The Visual C++ 2015 Build Tools are located here: http://landinghub.visualstudio.com/visual-cpp-build-tools

The Visual C++ 2017 Build Tools are now part of the regular VS 2017 installer. Just select the workloads you need. Information is on the same page.

This link is preferred to the blog links below as it's the official landing page and will be kept up-to-date.

I'm on the C++ team. If you have any questions about using the VC++ Build Tools or about MSVC in general, feel free to email me. My email is my StackOverflow user name @microsoft.com.


Once I tried to do same this as you. But MS doesn't provide isolated compiler. So if you need MS C++ compiler you must need to install the VS. But if you like to adventure. there is a tricky way to do that. Try it here. Chrees!


I ended up using Chocolatey, which has a package for Visual C++ Build Tools.

This command:

choco install visualcpp-build-tools 

will install the latest 2017 version, but you can select one of the older versions, which include the 2015 release.

After the installation Visual Studio 2017 folder is added to the Programs menu. It includes shortcuts to various developer command prompts with cl.exe and other tools in the path.


You can use MSVC compiler without Visual Studio and the latest version is available here:

http://www.microsoft.com/en-us/download/details.aspx?id=41151

Also here's a website which details the command line options for the compiler:

http://msdn.microsoft.com/en-us/library/9s7c9wdw.aspx


As of 2019 Microsoft offers Visual Studio Build Tools which only includes the compiler, build tools and SDK. It's hidden in the all downloads list.

참고URL : https://stackoverflow.com/questions/22290501/can-i-download-the-visual-c-command-line-compiler-without-visual-studio

반응형