Biso Posted August 2, 2004 Share Posted August 2, 2004 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 More sharing options...
0 Andareed Posted August 2, 2004 Share Posted August 2, 2004 #include <iostream> is the "correct" way (for ANSI compliance) to do this. Old visual studio 6 and lower used iostream.h. Link to comment Share on other sites More sharing options...
0 Biso Posted August 2, 2004 Author Share Posted August 2, 2004 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 More sharing options...
0 caustiK Posted August 2, 2004 Share Posted August 2, 2004 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 More sharing options...
0 smurfiness Posted August 3, 2004 Share Posted August 3, 2004 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 More sharing options...
0 bithub Posted August 3, 2004 Share Posted August 3, 2004 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 More sharing options...
0 Biso Posted August 3, 2004 Author Share Posted August 3, 2004 Do you mean that to choose Console Application (.NET) when creating new project or Win32 Console Project?? Link to comment Share on other sites More sharing options...
0 Andareed Posted August 3, 2004 Share Posted August 3, 2004 You should use win32 console. Link to comment Share on other sites More sharing options...
0 Genesi Posted August 4, 2004 Share Posted August 4, 2004 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 More sharing options...
Question
Biso
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