How to use GCC with Microsoft Visual Studio?

前端 未结 3 668
萌比男神i
萌比男神i 2020-11-28 06:08

I am creating a very large project (a few thousand lines) and so would rather not use Notepad++. An IDE would make it so much easier. I have experience with Microsoft Visual

3条回答
  •  情话喂你
    2020-11-28 06:48

    Clang

    You can use the Clang compiler with Visual Studio to target Android, iOS, and Windows.

    If you are targeting Android, you can use the Clang/LLVM compiler that ships with the Android NDK and toolchain to build your project. Likewise, Visual Studio can use Clang running on a Mac to build projects targeting iOS. Support for Android and iOS is included in the “Mobile Development with C++” workload. For more information about targeting Android or iOS check out our posts tagged with the keywords “Android” and “iOS”.

    If you are targeting Windows, you have a few options:

    1. Use Clang/LLVM; “Clang for Windows” includes instructions to install Clang/LLVM as a platform toolset in Visual Studio.
    2. Use Clang to target Windows with Clang/C2 (Clang frontend with Microsoft Code Generation).

    GCC

    If your project targets Linux or Android, you can consider using GCC. Visual Studio’s C++ Android development natively supports building your projects with the GCC that ships with the Android NDK, just like it does for Clang. You can also target Linux – either remotely or locally with the Windows Subsystem for Linux – with GCC.

    Check out our post on Visual C++ for Linux Development for much more info about how to use Visual Studio to target Linux with GCC. If you are specifically interested in targeting WSL locally, check out Targeting WSL from Visual Studio.

    Source: https://devblogs.microsoft.com/cppblog/use-any-c-compiler-with-visual-studio/

提交回复
热议问题