Sign in to follow this  
infernosnow

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 this post


Link to post
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 this post


Link to post
Share on other sites
infernosnow    139
Linking...
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 this post


Link to post
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 this post


Link to post
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
Under the Linker folder
Click System
Change Subsystem (the top option) to Console

Share this post


Link to post
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 this post


Link to post
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 this post


Link to post
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.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this