如何让c ++在Visual Studio for Mac上运行? [英] How do I get c++ to work on Visual Studio for Mac?

查看:878
本文介绍了如何让c ++在Visual Studio for Mac上运行?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

自从我成为程序员以来已经很久了。我正在介绍c ++,课堂上的其他人都在Windows上。我在Mac上。我一直在使用编辑器和命令行(在终端中)g ++编译器。它工作正常。


然而,教授希望我使用Visual Studio。我下载并将其安装在我的Mac上。到目前为止一直很好。


当我尝试创建一个c ++项目/程序时,它只给我创建c#程序的选项,至少它没有提供c ++选项。


那么,如何在Mac上的Visual Studio上编写和运行c ++程序?


谢谢。

解决方案

Hi OrchestraMusic,


欢迎来到MSDN论坛。


现在我们有两个Visual Studio版本(Visual Studio对于可直接安装在Mac(MacOS)上的Mac,Visual Studio Code),请参阅您的描述,看起来您安装了Visual Studio for Mac的
,它是一个针对构建移动和云应用程序而优化的开发人员环境使用Xamarin和.NET。在此版本中没有创建C ++项目的选项,其他一些社区成员向
Visual Studio产品团队报告了此建议,请检查:
支持Visual Studio for Mac中的C ++
,你可以投票给它,然后等待Visual Studio产品团队的反馈。


>>那么,如何在Mac上的Visual Studio上编写和运行c ++程序?


据我所知,有两个选项如下:


  1. 安装
    Visual Studio Code 和C / C ++构建工具,请查看博客:

    使用Visual Studio代码构建C ++应用程序
  2. 创建操作系统为Windows的VM,然后安装
    Visual Studio Communit y
    并选择在VS安装期间安装的C ++选项

如果你只是想要一个轻量级的工具来编辑你的C ++文件,VS代码已经涵盖了你,但如果你想在现有的Visual C ++项目中获得最佳体验
或在Windows上调试,我们建议您使用的是Visual Studio的一个版本,例如

Visual Studio社区





祝你好运,


萨拉


It's been a long time since I was a programmer. I'm taking an intro to c++ and everyone else in the class is on Windows. I'm on a Mac. I've been using an editor and the command line (in Terminal) g++ compiler. It's been working fine.

However, the professor wants me to use Visual Studio. I downloaded it and installed it on my Mac. So far so good.

When I try to create a c++ project/program it only gives me the option of creating c# programs, at least it doesn't give a c++ option.

So, how can I write and run c++ programs on Visual Studio on a Mac?

Thank you.

解决方案

Hi OrchestraMusic,

Welcome to the MSDN forum.

Now we have two Visual Studio versions (Visual Studio for Mac, Visual Studio Code) that can directly install on the Mac (macOS), refer to your description, it looks like you installed the Visual Studio for Mac, it is a developer environment optimized for building mobile and cloud apps with Xamarin and .NET. There has no option to create C++ project in this version and some other community members reported this suggestion to the Visual Studio Product Team, please check this: Support C++ in Visual Studio for Mac and you can vote it, then waiting for the feedback from the Visual Studio Product Team.

>> So, how can I write and run c++ programs on Visual Studio on a Mac?

As far as I know, there have two options as below:

  1. Install Visual Studio Code and C/C++ build tools, please have a look at blog: Building your C++ application with Visual Studio Code
  2. Create a VM that OS is windows, then install the Visual Studio Community and choose the option C++ to install during the VS installation

If you just want a lightweight tool to edit your C++ files, VS Code has you covered but if you want the best possible experience for your existing Visual C++ projects or debugging on Windows, we recommend you use a version of Visual Studio such as Visual Studio Community.

Best regards,

Sara


这篇关于如何让c ++在Visual Studio for Mac上运行?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆