• 0

C++ .net <iostream.h>


Question

Dears,

Finally I could upgrade my vs.net 2002 to 2003, but unfortunately my old programs didn't work and the reason was

#include<iostream>

The funny thing that I was asked the same question from 14 people ;) and I tried hard to fine a clue but in vain...

Thanks in advance

Abbas Adel

Link to comment
Share on other sites

8 answers to this question

Recommended Posts

  • 0

Thanks Andareed

I tried this simple code and git these errors:

#include<iostream>

using namespace std;

void main()

{

cout << "test";

}

------------------

test error LNK2019: unresolved external symbol _WinMain@16 referenced in function _WinMainCRTStartup

test fatal error LNK1120: 1 unresolved externals

Could you please help me with that?

Link to comment
Share on other sites

  • 0

that sounds like you're trying to compile as a win32 program. make sure you select console application. in fact, blank applications are probably best for those anyways. open a blank solution console application and then add new source files.

Link to comment
Share on other sites

  • 0

The old C++ streams were deprecated in Visual Studio 2002, and removed in 2003. 2002 included a compiler warning that warned you about this.

If you have a copy of 2002, you can move the header and source files over from that version to 2003 and your program will compile fine, but they're no longer part of the SDK.

Link to comment
Share on other sites

  • 0

That error is probably due to you attempting to compile a console application, but you selected win32 application in the settings ( as caustiK already pointed out).

win32 applications done use the main() entry point, instead they use WinMain(). Go to your project link settings, and change "windows" to "console".

Link to comment
Share on other sites

  • 0

I'm stepping through this with the professional version so hopefully it will be somewhat the same as yours. Assuming you want a console application:

Step One: Click on File->New and a dialog will appear.

Step Two: On the left plane that says Visual C++ Projects have the first option selected, which it should be by default.

Step three: On the right plane scroll down until you see a win32 console application. Type in a name and click ok

Step Four: Click on the application settings and check empty project then hit finish.

This should get you where you need to be. Just copy and paste the code into this solution and you should be fine.

Link to comment
Share on other sites

This topic is now closed to further replies.
  • Recently Browsing   0 members

    • No registered users viewing this page.