Microsoft Visual C++ 2010 can't debug?

I installed the program, and wrote a simple C program to try it, but I couldn't build it or anything ! The debug, build and run options are all greyed out ! I can't click them Please help :(

Upvotes: 0

Views: 2249

Answers (1)

Nasreddine
Nasreddine

Reputation: 37788

In Visual Studio your code needs to be in a Project before you can Build/Debug it. You can't just open your .cpp file and run it. (When you create a project, Visual Studio creates a solution to contain it (a solution can contain many projects))

You can Create a new project using File -> New -> Project :

enter image description here

then add your code to that project or if the you already have your source code files you can use the "Create a Project from Existing Code Files" wizard which is available under File -> New -> Project from existing code

enter image description here

Upvotes: 2

Related Questions