Где находится C# компилятор последней версии?
Ребят, я тут хочу с помощью команды Console.WriteLine() вывести слово вместе с интерполяции строки. О чём я имею виду:
Всё работает если запустить проект через Microsoft Visual Studio. Также нормально компилирует Developer Prompt.
Но путь компилятора:
пишет: Не предвиденный символ «$»
Какой компилятор использует Visual Studio и Developer Prompt, и где находится этот компилятор, скажите пж!
Microsoft Visual Studio 2019 Enterprise
P.s.: не пишите что нужен C# компилятор 6.0 или 5.0, я знаю. И также не пишите про путь
Не уверен, что все еще актуально для автора, но корректный ответ все же нужен.
Нельзя путать версию компилятора и версию синтаксиса языка. Версия компилятора в вашем случае значения не имеет, а вот версия синтаксиса, судя по тексту вопроса, очень даже имеет, т.к. именно от версии синтаксиса зависит поддержка тех или иных конструкций языка в тексте компилируемой программы.
Для того чтобы указать конкретную версию синтаксиса компилятору, используется специальный ключ для консольного компилятора csc.exe: -langversion. В документации есть полный список доступных на данный момент версий синтаксиса, который также можно получить во встроенной справке самого компилятора по ключу /? или -?.
Учтите, что в стандартной поставке .NET Framework, компилятор умеет работать только с версиями синтаксиса C# до 5.0 включительно, для поддержки более новых версий, которые еще не стандартизованы, нужно будет более детально ознакомиться с документацией и добавить все необходимое, например компилятор Roslyn, или перейти с .NET Framework на .NET Core, возможно есть и другие варианты, глубоко не копал.
Use any C++ Compiler with Visual Studio
Microsoft Visual Studio 2017 supports several C++ compilers to suit a wide variety of codebases. In addition to the Microsoft Visual C++ compiler that many of you are likely familiar with, Visual Studio 2017 also supports Clang, GCC, and other compilers when targeting certain platforms.
This post is intended to familiarize you with the variety of C++ compilers that are compatible with the Visual Studio IDE, and to understand when they might be applicable to use with your projects. Some compilers may be better suited to your needs depending on your project or target. Alternatively, you may be interested in checking out new language features, such as C++ Concepts, that are not available across all compilers without needing to leave the IDE.
You can select the compiler and corresponding toolset that will be used to build a project with the “Platform Toolset” property under General Configuration Properties for C++ projects. Any installed compilers that are applicable to your project type will be listed in the “Platform Toolset” dropdown.
Microsoft C++ Compiler (MSVC)
If you are targeting Windows, the Microsoft C++ compiler (MSVC) may be the way to go. This is the default compiler for most Visual Studio C++ projects and is recommended if you are targeting Windows.
Compiler options for the Microsoft C++ compiler.
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:
- Use Clang/LLVM; “Clang for Windows” includes instructions to install Clang/LLVM as a platform toolset in Visual Studio.
- Use Clang to target Windows with Clang/C2 (Clang frontend with Microsoft Code Generation).
Compiler options for the Clang/C2 compiler.
It might make sense to use Clang/C2 if you want to bring a codebase that takes advantage of Clang’s language features to the Windows platform. Since the code generation and optimization is handled by the MSVC backend, binaries produced by Clang/C2 are fully compatible with binaries produced by MSVC. You can learn more about Clang/C2 from Clang with Microsoft Codegen – or check out the latest updates in posts tagged with the keyword “clang”.
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.
Compiler options for 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.
Closing
Visual Studio also makes use of the Edison Design Group (EDG) frontend to provide flexible IntelliSense regardless of whether you use MSVC, Clang, or GCC to build your code. Visual Studio gives you access to a wide range of choices when it comes to C++ compilers. This way you can make sure that as you develop your code, it continues to compile against all major compilers.
Install Visual Studio today and give it a try. Please let us know if we have missed any compilers you use, and share your feedback as we look forward to improving your C++ development experience.
Name already in use
cpp-docs / docs / overview / visual-cpp-tools-and-features-in-visual-studio-editions.md
- Go to file T
- Go to line L
- Copy path
- Copy permalink
- Open with Desktop
- View raw
- Copy raw contents Copy raw contents
Copy raw contents
Copy raw contents
C++ Tools and Features in Visual Studio Editions
The following C++ features are available in Visual Studio. Unless stated otherwise, all features are available in all editions: Visual Studio Community, Visual Studio Professional, and Visual Studio Enterprise. Some features require specific workloads or optional components, which you can install with the Visual Studio Installer.
The following tables show Visual C++ features that are available in Visual Studio 2017. An X in a cell indicates that the feature is available; an empty cell indicates that the feature is not available. Notes in parentheses indicate that a feature is available, but restricted.
- Windows Desktop
- Universal Windows Platform ((tablet, PC, Xbox, IoT, and HoloLens))
- Linux
- Android
- iOS
Platform | Visual Studio Express for Windows 10 | Visual Studio Express for Windows Desktop | Visual Studio Community/Professional | Visual Studio Enterprise |
---|---|---|---|---|
Windows Desktop | X | X | X | |
Universal Windows Platform ((phone, tablet, PC, Xbox, IoT, and HoloLens)) | X | X | X | |
Linux | X | X | ||
Microsoft Store 8.1 | X | X | ||
Windows Phone 8.0 | X | X | ||
Android | X | X | ||
iOS | X | X |
- MSVC 32-bit compiler for x86, x64, ARM, and ARM64
- MSVC 64-bit compiler for x86, x64, ARM, and ARM64
- GCC cross-compiler for ARM
- Clang/LLVM
- On Windows, Clang/LLVM 12.0, targeting x86 or x64 (CMake support only).
- On Linux, any Clang/LLVM installation supported by the distro.
Compiler Visual Studio Express for Windows Visual Studio Express for Windows Desktop Visual Studio Professional / Community Visual Studio Enterprise MSVC 32-bit X86 compiler X X X X x86_arm cross-compiler X X X MSVC 64-bit x64 compiler X X x86_x64 cross-compiler X X X X Visual Studio includes the following workloads for C++ development. You can install any or all of these, along with other workloads such as .NET Desktop Development, Python Development, Azure Development, Visual Studio Extension Development, and others.
Desktop development with C++
- C++ core desktop features
- MSVC v143 — VS 2022 C++ x64/x86 build tools (latest)
- Windows 10 SDK (latest for this Visual Studio version)
- Just-In-Time debugger
- C++ profiling tools
- C++ CMake tools for Windows
- C++ ATL for v143 build tools (x86 & x64)
- Test Adapter for Boost.Test
- Test Adapter for Google Test
- Live Share
- IntelliCode
- C++ AddressSanitizer
- IntelliTrace (Enterprise only)
- MSVC v143 — VS 2022 C++ ARM64 build tools (latest)
- C++ MFC for latest v143 build tools (x86 & x64)
- C++/CLI support for v143 build tools (latest)
- C++ Modules for v143 build tools (x64/x86 – experimental)
- C++ Clang tools for Windows (12.0.0 — x64/x86)
- JavaScript diagnostics
- IncrediBuild — Build Acceleration
- Windows 11 SDK
- Windows 10 SDK (other versions)
- MSVC v142 — VS 2019 C++ x64/x86 build tools (v14.29)
- MSVC v141 — VS 2017 C++ x64/x86 build tools (v14.16)
- MSVC v140 — VS 2015 C++ build tools (v14.00)
- MSVC v142 — VS 2019 C++ x64/x86 build tools (latest)
- Windows 10 SDK (latest for this Visual Studio version)
- Just-In-Time debugger
- C++ profiling tools
- C++ CMake tools for Windows
- C++ ATL for v142 build tools (x86 & x64)
- Test Adapter for Boost.Test
- Test Adapter for Google Test
- Live Share
- IntelliCode
- C++ AddressSanitizer
- IntelliTrace (Enterprise only)
- MSVC v142 — VS 2019 C++ ARM64 build tools (latest)
- C++ MFC for latest v142 build tools (x86 & x64)
- C++/CLI support for v142 build tools (latest)
- C++ Modules for v142 build tools (x64/x86 – experimental)
- C++ Clang tools for Windows
- JavaScript diagnostics
- IncrediBuild — Build Acceleration
- Windows 11 SDK
- Windows 10 SDK (other versions)
- MSVC v141 — VS 2017 C++ x64/x86 build tools (v14.16)
- MSVC v140 — VS 2015 C++ build tools (v14.00)
Linux development with C++
- C++ core features
- C++ for Linux Development
- C++ CMake tools for Linux
- IntelliCode
- Embedded and IoT development tools
Universal Windows Platform development
- Blend for Visual Studio
- .NET Native and .NET Standard
- NuGet package manager
- Universal Windows Platform tools
- Windows 10 SDK (latest for this Visual Studio version)
- IntelliCode
- IntelliTrace (Enterprise only)
- USB Device Connectivity
- C++ (v143) Universal Windows Platform tools
- C++ (v142) Universal Windows Platform tools
- C++ (v141) Universal Windows Platform tools
- Graphics debugger and GPU profiler for DirectX
- Windows 11 SDK
- Windows 10 SDK (other versions)
- Architecture and analysis tools
- IntelliCode
- IntelliTrace (Enterprise only)
- USB Device Connectivity
- C++ (v142) Universal Windows Platform tools
- C++ (v141) Universal Windows Platform tools
- Graphics debugger and GPU profiler for DirectX
- Windows 11 SDK
- Windows 10 SDK (other versions)
- Architecture and analysis tools
C++ Game Development
- C++ core features
- Windows Universal C Runtime
- C++ 2019 Redistributable Update
- MSVC v143 — VS 2022 C++ x64/x86 build tools (latest)
- C++ profiling tools
- C++ AddressSanitizer
- Windows 10 SDK (latest for this Visual Studio version)
- IntelliCode
- IntelliTrace (Enterprise only)
- Windows 11 SDK
- Windows 10 SDK (other versions)
- IncrediBuild — Build Acceleration
- Cocos
- Unreal Engine installer
- Android IDE support for Unreal engine
- C++ core features
- Windows Universal C Runtime
- C++ 2019 Redistributable Update
- MSVC v142 — VS 2019 C++ x64/x86 build tools (latest)
- C++ profiling tools
- Windows 10 SDK (latest for this Visual Studio version)
- IntelliCode
- IntelliTrace (Enterprise only)
- Windows 11 SDK
- Windows 10 SDK (other versions)
- IncrediBuild — Build Acceleration
- Cocos
- Unreal Engine installer
- Android IDE support for Unreal engine
Mobile development with C++
- C++ core features
- Android SDK setup (API level 25) (local install for Mobile development with C++)
- Android NDK (R21E)
- Apache Ant (1.9.3)
- C++ Android development tools
- IntelliCode
- Intel Hardware Accelerated Execution Manager (HAXM) (local install)
- C++ iOS development tools
- IncrediBuild — Build Acceleration
- Android NDK (R16B)
- Apache Ant (1.9.3)
- C++ Android development tools
- IntelliCode
- Google Android Emulator (API Level 25) (local install)
- Intel Hardware Accelerated Execution Manager (HAXM) (local install)
- Android NDK (R16B) (32bit)
- C++ iOS development tools
- IncrediBuild — Build Acceleration
You can install these components independently from any workload.
- JavaScript diagnostics
- Live Share
- C++ Universal Windows Platform runtime for v142 build tools
- ClickOnce Publishing
- Microsoft Visual Studio Installer Projects
- Windows SDK
Libraries and Headers
- Windows headers and libraries
- Windows Universal C Runtime (CRT)
- C++ Standard Library
- ATL
- MFC
- .NET Framework class library
- C++ Support Library for .NET
- OpenMP 2.0
- Over 900 open-source libraries via vcpkg catalog
Library or Header Visual Studio Express for Windows Visual Studio Express for Windows Desktop Visual Studio Professional / Community Visual Studio Enterprise Windows headers and libraries and CRT library (X) X X X C++ Standard Library X X X X ATL X X MFC X X .NET Framework class library X X X C++ Support Library for .NET X X X OpenMP 2.0 X X X X Build and Project Systems
- CMake
- Any build system via Open Folder
- Command line builds (msbuild.exe)
- Native Multi-targeting
- Managed Multi-targeting
- Parallel Builds
- Build Customizations
- Property Pages Extensibility
Build or Project Feature Visual Studio Express for Windows Visual Studio Express for Windows Desktop Visual Studio Professional / Community Visual Studio Enterprise Command line builds (msbuild.exe) X X X X Native Multi-targeting X X X Managed Multi-targeting X X X Parallel Builds X X X X Build Customizations X X X X Property Pages Extensibility X X X X The following project templates are available depending on which workloads you have installed.
Какой компилятор в visual studio
This forum has migrated to Microsoft Q&A. Visit Microsoft Q&A to post new questions.
- ProfileText
- Sign in
Answered by:
Question
Answers
The compiler will predefine some macros that you can detect to determine which compiler you are using.
For example, Microsoft Visual C++ is defining _MSC_VER to a value:
You should be able to make use of something like #ifdef _MSC_VER and #if _MSC_VER > 1400 or whatever your specific needs are.
You can also detect symbols like __WIN32__ to detect if you are in a Windows build environment. Some compilers will define __unix__ or __APPLE__ if your build environment is of that variety.