I recently installed Microsoft Visual Studio 2010 on my computer. I wrote a C++ program and I can't find any Build/Compile/Run options in Visual Studio 2010.
Please, any one can tell me how can I compile C++ programs in MS Visual Studio 2010.

Microsoft decided to hide that menu on you thinking that programmers are too dumb to know how to use it. To activate the Build menu click on Tools --> Settings then select Expert.

commented: Good one, I hadn't stumbled onto that yet +4

Microsoft decided to hide that menu on you thinking that programmers are too dumb to know how to use it. To activate the Build menu click on Tools --> Settings then select Expert.

Wow are you serious?

I thought this was just some sort of troll ^^

(Or maybe it's a Microsoft troll :P)

>>Wow are you serious?

Absolutely dead searious. The problem does really exist. :@

>>Microsoft decided to hide that menu on you thinking that programmers are too dumb to know how to use it.

Microsoft has a thing for this. When I finally knew where all the buttons and menus were in office, they decided that is was time for a new look and randomized them all...
Now they did the same thing with VS. I mean, someone has tested the new VS right? You would think he would have noticed: "Hey! The build button has diappeared!". But no: the most used button OF THE ENTIRE PROGRAM was sacrificed to put in even more buttons to even more functions of VS that I'll never use.... *sigh*

I didn't even realise it was missing ^^

Control+Shift+B is my most favouritest shortcut, I push it without realising sometimes ^^ (and Shift+F6 of course)

Microsoft decided to hide that menu on you thinking that programmers are too dumb to know how to use it. To activate the Build menu click on Tools --> Settings then select Expert.

I am unable to find the option to enable the Build Menu, can you provide some screenshots.

Here you go

Here you go

I don't have Visual C++ express, I have MS Visual Studio installed. And there is no such option in MS Visual Studio.

Microsoft decided to hide that menu on you thinking that programmers are too dumb to know how to use it. To activate the Build menu click on Tools --> Settings then select Expert.

Hey
I downloaded and installed MS Visual C++ from MSDN site. In the tools menu, I went into settings and clicked on Expert, but still the Build menu didn't appear.

I have attached a screenshot.

Umm... can you export your settings and send them to me so I can import them?

>>Umm... can you export your settings and send them to me so I can import them?

AFAIK that is not possible. You might want to post your question at Microsoft's forum

@AncientDragon: Yeah you can, but that's not the problem here if I saw correctly.

@Op: You need to create a Solution and a Project for that file. You cannot compile individual files like you would in say gcc.

Goto File, Create new project, it will automatically create a solution for that project. Just make an empty console project. Once that's done, right click the project, then click Add Existing Item...
Go find your file, select it and click Add.

You can then build your file :)

commented: nice catch :) +28
commented: Haha, I totally missed that :) +13

I have managed to compile my program on Visual C++ 2010.
Umm... now how can I execute it? I can't find any Execute or Run command.

Press F5 on your keyboard, or click the green "Play" symbol on the toolbar at the top

Press F5 on your keyboard, or click the green "Play" symbol on the toolbar at the top

Thanks for the info.

I saved the C++ code in notepad and saved with ''.cpp'' in desktop, and continued this procedure:
Visual studio tools>>-- visual studio command prompt>>-- cl filename.cpp
I deal with this error:

fatal error C1083: cannot open source file: filename.cpp: No such file or directory.

Also I tried it with the saved file ''filename.cpp'' in ''C:My Documents\Visual Studio 2010\Projects'', but it has the same error!
Do you know why?

they are in different directories.
why use the commd prompt to compile the cpp file.

Could you please tell me how I can know the directory to save the notepad.cpp file?
I tried this also:

  • '' Open Microsoft Visual C++ Express 10
  • Click on "File" (upper left) -> New -> Project
  • Select "Win32 Console Application"
  • On the bottom side of the window, type in your projects name as "Example" (so it will be -- Name: Example)
  • For me, the project location is: C:\Documents and Settings\Muted\My Documents\Visual Studio 2010\Projects
  • Click "OK"
  • Click "Next"
  • Select "Console Application" as the application-type
  • UNcheck "pre-compiled headers"
  • CHECK "Empty project"
  • Click "Finish"
  • In the left pane, right click on "Source Files" -> Add -> New Item... -> "C++ File"
  • Name: example.cpp
  • Click on "Add" (lower right corner)
  • Enter the source code (shown below...)
  • Press F7 (build hotkey)
  • Press F5 (run "debug" hotkey)''

but the error is:

This project is out of date

I noticed something now, maybe it's because the code file doesn't contain head file and subroutine, should I save them in the ''C:\Documents and Settings\Muted\My Documents\Visual Studio 2010\Projects''?

You can put your code anywhere you want. When you create a new project it asks for the project name and location. I don't like that long path so I always put my source code in c:\dvlp folder. Makes it very simple to find that way.

This project is out of date

I got that occasionally too -- just let it rebuild and you can then run the program.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.