1.11M Members

how to compile in visual studio 2010

 
0
 

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.

 
2
 

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.

 
0
 

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)

 
0
 

>>Wow are you serious?

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

 
1
 

>>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*

 
0
 

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)

 
0
 

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.

 
0
 

Here you go

Attachments Untitled.png 523.55KB
 
0
 

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.

 
0
 

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?

Attachments nobuild.gif 169.67KB
 
0
 

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

 
4
 

@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 :)

 
0
 

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.

 
0
 

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

 
0
 

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

Thanks for the info.

Question Answered as of 4 Years Ago by Ancient Dragon, Ketsuekiame and Nick Evan
 
0
 

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?

 
1
 

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

 
0
 

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

 
0
 

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''?

 
0
 

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.

You
This question has already been solved: Start a new discussion instead
Post:
Start New Discussion
Tags Related to this Article