new to Visual Studio and c++ and cant run my first program

Posted on 2009-02-17
Last Modified: 2013-12-14
new to Visual Studio and c++ and cant run my first program
when compile program below I get error as per the screeshot

#include <iostream.h>

int main() {

	cout << "Hello World!!! \n";

	return 0;


Open in new window

Question by:jtiernan2008
    LVL 1

    Author Comment

    LVL 19

    Accepted Solution

    You are missing std:: in front of cout i.e. it should be:

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

    or add:

    using namespace std;

    right after #include <iostream>

    This is however not the cause for this particular error, it seems that something is wrong with the project settings and looking on the right side of the image there is no Source file listed there, I would recommend creating a new project:

    1) File -> New -> Project
    2) Make sure you select "Win32 Console Application"
    3) On the wizard ensure "Console application" is selected
    4) Check "Empty project"
    5) Right-click on the "Source Files" folder on the right-side
    6) Select "Add" then "New Item"
    7) Select "C++ File (.cpp)"
    8) Enter a name, e.g. "main"
    9) Add your code and run the application
    #include <iostream>
    int main() 
    	std::cout << "Hello World!!! \n";
    	return 0;

    Open in new window


    Featured Post

    Looking for New Ways to Advertise?

    Engage with tech pros in our community with native advertising, as a Vendor Expert, and more.

    Join & Write a Comment

    Here is a helpful source code for C++ Builder programmers that allows you to manage and manipulate HTML content from C++ code, while also handling HTML events like onclick, onmouseover, ... Some objects defined and used in this source include: …
    Jaspersoft Studio is a plugin for Eclipse that lets you create reports from a datasource.  In this article, we'll go over creating a report from a default template and setting up a datasource that connects to your database.
    The viewer will learn how to synchronize PHP projects with a remote server in NetBeans IDE 8.0 for Windows.
    The viewer will learn how to use and create new code templates in NetBeans IDE 8.0 for Windows.

    754 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    19 Experts available now in Live!

    Get 1:1 Help Now