Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to use g++ compiler in Visual Studio

Cant find any easy way to compile c++ projects under g++ in visual studio 2019. All I can find are tutorials for Visual Studio Code, not the full Visual Studio.

like image 624
ShoeMaker Avatar asked Jan 26 '20 23:01

ShoeMaker


People also ask

Can I use GCC in Visual Studio?

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.

How do I run a compiler in Visual Studio?

Build and run your code in Visual Studio To build your project, choose Build Solution from the Build menu. The Output window shows the results of the build process. To run the code, on the menu bar, choose Debug, Start without debugging. A console window opens and then runs your app.

Can you use g ++ in Visual Studio?

In this tutorial, you configure Visual Studio Code to use the GCC C++ compiler (g++) and GDB debugger from mingw-w64 to create programs that run on Windows. After configuring VS Code, you will compile and debug a simple Hello World program in VS Code.

How do I add a compiler code to Visual Studio?

Open VS Code. Select the Extensions view icon on the Activity bar or use the keyboard shortcut (Ctrl+Shift+X). Search for 'C++' . Select Install.


1 Answers

You can use a Linux emulator on your Windows machine like Cygwin or WSL to compile and run your programs (along with gaining access to other Linux terminal features).

You'll just have to set up the environment and install the packages you want (in your case, gcc-g++).

like image 59
size_t yler Avatar answered Oct 17 '22 23:10

size_t yler