Jump to content

Beginner in C++!How to compile using visual studio 2010 express

- - - - -

  • Please log in to reply
5 replies to this topic

#1
charlote

charlote

    Newbie

  • Members
  • PipPip
  • 29 posts
I am new to C++ and been trying to do small program. I created the source code and when I try to compile the program, it gives the following message:

unable to start program 'C:\users\...\visual studio 2010\projects\basic.cpp\Debug\basic.cpp.exe.

The system cannot find the file specified.

Can anyone tell me what I am doing wrong?

#2
mnirahd

mnirahd

    Programming Professional

  • Members
  • PipPipPipPipPip
  • 330 posts
Hi,

Its hard to tell using the information you have provided. What's the name of project you created: Are you sure you selected correct project type while creating it. I assume you're trying to create a console based application. Are you sure that you select win32 console when you created project?

Munir

#3
Ancient Dragon

Ancient Dragon

    Programming Expert

  • Members
  • PipPipPipPipPipPip
  • 400 posts
Hereare some tutorials how to use that compiler and IDE
Visit Grandpa's Forums, a social networking forum, with family-oriented arcade games, blogs, discussion forums, and photo albums.

#4
charlote

charlote

    Newbie

  • Members
  • PipPip
  • 29 posts

mnirahd said:

Hi,

Its hard to tell using the information you have provided. What's the name of project you created: Are you sure you selected correct project type while creating it. I assume you're trying to create a console based application. Are you sure that you select win32 console when you created project?

Munir

I am sorry. It is a console based application. Project name is basic.cpp(it is just a basic to get started). I did select win32 console when I created it. but still it gives the message... as program unable to start

Thanks

#5
Muted

Muted

    Learning Programmer

  • Members
  • PipPipPip
  • 86 posts

charlote said:

I am sorry. It is a console based application. Project name is basic.cpp(it is just a basic to get started). I did select win32 console when I created it. but still it gives the message... as program unable to start

Thanks
Hello, charlote.

Here's a basic walk-through to create a new Win32 console project with MSVC 10 Express:

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


SOURCE CODE:
#include <iostream>

int main() {

    std::cout << "Hello World!";

    char holdExecutionWindowOpen;
    std::cin >> holdExecutionWindowOpen;

    return 0;
}

There you go! Hope this helps! :c-smile:
“You may be disappointed if you fail, but you are doomed if you don't try.”
- Beverly Sills

#6
charlote

charlote

    Newbie

  • Members
  • PipPip
  • 29 posts

Ancient Dragon said:

Hereare some tutorials how to use that compiler and IDE

Thanks, It is very helpful.




1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users