Problem with Simplest Program

Hello,

New to C++, but I have been trying to run a more complicated program and getting some errors, so I tried to run the simplest one and am getting the same errors, so it's probably some configuration problem.

The errors:

------ Build started: Project: sample2, Configuration: Debug Win32 ------
MSBUILD : warning MSB4196: The "*.overridetasks" files could not be successfully loaded from their expected location "c:\WINDOWS\Microsoft.NET\Framework\v4.0.30319\". Default tasks will not be overridden. The file or directory is corrupted and unreadable.
MSBUILD : warning MSB4196:
MSBUILD : warning MSB4010: The "*.tasks" files could not be successfully loaded from their expected location "c:\WINDOWS\Microsoft.NET\Framework\v4.0.30319". Default tasks will not be available. The file or directory is corrupted and unreadable.
MSBUILD : warning MSB4010:
c:\WINDOWS\Microsoft.NET\Framework\v4.0.30319\Microsoft.Common.Targets(486,9): error MSB4036: The "Message" task was not found. Check the following: 1.) The name of the task in the project file is the same as the name of the task class. 2.) The task class is "public" and implements the Microsoft.Build.Framework.ITask interface. 3.) The task is correctly declared with <UsingTask> in the project file, or in the *.tasks files located in the "c:\WINDOWS\Microsoft.NET\Framework\v4.0.30319" directory.
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========

THE CODE that generated these errors:

#include <iostream>
using namespace std;

void main()
{
cout<<"Hello";
}

Any help would be extremely helpful!
Thanks a lot in advance.
i'd suggest either to try

#include <iostream>
using namespace std;

int main() // main is supposed to be int !
{
cout<<"Hello";
return 0;
}

or reinstall .NET framwork, it says "directory is corrupted and unreadable."
I would actually suggest:
1
2
3
4
5
6
7
8
9
10
#include <iostream>

using std::cout;
using std::endl;

int main()
{
    cout << "Hello" << endl;
    return 0;
}
You made the project with the wrong configuration.

Trash this project and start a new one.

When you make a new project in Visual Studio, make sure of the following:

- You want a Win32 console project
- You do not want anything that says "Managed", "C++/CLI", or ".NET"
- You want to check the "empty project" checkbox
The best that I can suggest is to try what timmyyyyy or ciphermagi suggested.
Topic archived. No new replies allowed.