Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

No build menu in Visual Studio when opening an existing cpp file

I am new to Visual Studio. I just followed a tutorial and successfully wrote and ran a simple program. But after I closed Visual Studio and double click the cpp file I just wrote. I can't find the build menu in the Visual Studio. Could anyone tell me how to open and run the existing cpp file? I need to do some debug and don't want to begin a new project and copy the code again and again. Thanks!

like image 958
jason Avatar asked Jan 19 '16 02:01

jason


People also ask

How do I open an existing C++ project in Visual Studio?

Open vs, create a VC++ MFC Application project. In Solution Explorer, right-click on the solution,select Add->New Project. Choose Visual C++ > Windows Desktop Wizard and it popups the wizard windows, click 'Cancel' button.

How do I get build options in Visual Studio?

If you want to build multiple configurations and platforms in one action, you can use the Build > Batch Build option in Visual Studio. To access this feature, press Ctrl+Q to open the search box, and enter Batch build .

Where is the Build button in Visual Studio?

Simply activate the "Build" toolbar in View > Toolbars. This adds the Start Without Debugging, Build Project, and Build Solution buttons to the Toolbar.

How do I run a specific CPP File in Visual Studio?

Click the "File" menu item, then select "Open." Double-click the CPP file to load the source code in Visual Studio.


1 Answers

You need to open more than the .cpp file alone.

Make sure you open the whole project or solution (File/Open/Project - .sln, .vcxproj, .vcproj). Double clicking on a .cpp file will open that file only.

Then you should be able to build the project (or hit Ctrl-F5).

like image 74
Danny_ds Avatar answered Oct 02 '22 18:10

Danny_ds