getting hello world program to compile

Hi adtyerheryh!

cite="mid2c5ec770-d581-416b-9400-82a36f071b81@discussions.microsoft.com"

type="cite">I made a new blank project (er... "solution") and created

this source file in it:
#include <stdio>

int main () {

cout << "Hello World";

return 0;

}
When compiling it I got an error message saying stdafx.h was missing.

When I included it I got a different error message. What am I missing?

Disable "Precompiled headers" in the project settings!

"Project|Settings|C++|Precompiled headers": None (or off).

--

Greetings

Jochen
My blog about Win32 and .NET

http://blog.kalmbachnet.de/

[1039 byte] By [MVPUser] at [2008-2-19]
# 1
I made a new blank project (er... "solution") and created this source file in it:
#include <stdio>
int main () {
cout << "Hello World";
return 0;
}
When compiling it I got an error message saying stdafx.h was missing. When I included it I got a different error message. What am I missing?
adtyerheryh at 2007-8-21 > top of Msdn Tech,Visual C++,Visual C++ General...
# 2
wrote in message

news:2c5ec770-d581-416b-9400-82a36f071b81@discussions.microsoft.com

> I made a new blank project (er... "solution") and created this source

> file in it:

>

> #include

> int main () {

> cout << "Hello World";

> return 0;

> }

Be aware that there is no header named stdio - there's one named stdio.h. Further, cout is defined in iostream header, not in stdio.h. Further still, all STL symbols including cout are in namespace std.

Putting it together, your program should read

#include

int main () {

std::cout << "Hello World";

return 0;

}

--

With best wishes,

Igor Tandetnik

MVPUser at 2007-8-21 > top of Msdn Tech,Visual C++,Visual C++ General...
# 3
Try this:

#include <stdio.h>
using namespace std;

int main () {
cout << "Hello World";
return 0;
}
ItsMe at 2008-2-22 > top of Msdn Tech,Visual C++,Visual C++ General...