none
How do I get c++ to work on Visual Studio for Mac?

    Question

  • 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.

    Wednesday, March 01, 2017 3:13 PM

All replies

  • 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


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    Friday, March 03, 2017 2:12 AM
    Moderator