# can't find iostream.h file error

## Recommended Posts

infernosnow    139
#include <iostream.h> main() { cout << "Hello World!"; return 0; } Quit possibly the most simple program ever and I can't get it to work. VC++ .NET error C1083 Using a Win32 project file.

##### Share on other sites
SiCrane    11839
MSVC .NET 2003 stopped shipping <iostream.h>. You should update your code to use <iostream>.

##### Share on other sites
Roboguy    794
The code you gave is non-standard, you might want to try:
#include <iostream>int main(){    std::cout << "Hello World!";    return 0;}

##### Share on other sites
infernosnow    139
still doesn't work... I still get the 2019 error. Now I'm also getting an LNK1120 error. "1 unresolved externals"

##### Share on other sites
Roboguy    794
Can you be a bit more specific? What is the exact error?

##### Share on other sites
infernosnow    139
LIBCD.lib(wincrt0.obj) : error LNK2019: unresolved external symbol _WinMain@16 referenced in function _WinMainCRTStartup
Debug/myApp.exe : fatal error LNK1120: 1 unresolved externals

##### Share on other sites
SiCrane    11839
You started a windows application when you wanted a console application. The simplest way to fix this at this point is to recreate the project.

##### Share on other sites
infernosnow    139
so how do I get "Hello WOrld" to appear in a windows application?

##### Share on other sites
Promit    13246
You can't. There's an easier way to to change it to a console app though.

Project->Properties
Click System
Change Subsystem (the top option) to Console

##### Share on other sites
infernosnow    139
Ok, well I know you can get text to appear in a windows application somehow ;)

so I wrote out www.kryolinth.com/mycode.txt

which creates a window and whatnot, but you'll see where I have cout and whatnot. So how do you make text appear in a windows application?

##### Share on other sites
You have to create a windows application and know the Windows Api. It's quite complicated compared to what you're at. Stick with console (MS DOS) applications for a while until you get the basics down. Then look for some tutorials on windows programming. Or, you could look for a tutorial right now and see just how complicated it is.

##### Share on other sites
Shannon Barber    1681
I thought the default Win32 project did exactly that? (Printed Hello World on a form?)

You first have to create a Win32 Application complete with a WinMain and a message pump. Then you have to register and create your wwindow, then you can draw on its canvas and write out letters with the Win32 font drawing functions.