Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / Languages / Managed C++ / March 2006

Tip: Looking for answers? Try searching our database.

Help with <iostream.h> and Linker errors

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Chris Jones - 02 Mar 2006 15:28 GMT
I am using the old <iostream.h>. When I compile a simple test program that
uses <iostream.h>, Visual C++ 7 gives me this strange error:

Compiling...
capp.cpp
C:\Program Files\Microsoft Visual Studio .NET\Vc7\include\useoldio.h(29) :
warning C4995: '_OLD_IOSTREAMS_ARE_DEPRECATED': name was marked as #pragma
deprecated
Linking...
LIBCMTD.lib(crt0.obj) : error LNK2019: unresolved external symbol _main
referenced in function _mainCRTStartup
Debug/Test.exe : fatal error LNK1120: 1 unresolved externals

I did some digging and found out the <iostream.h> was far outdated.
Therefore, I include the new iostream, <iostream>, but then the compiler says
that cout and cin (the only iostream commands I used) were not defined. How
can I use cout and cin without getting a compiler (or linker) error?
David Wilkinson - 02 Mar 2006 15:36 GMT
> I am using the old <iostream.h>. When I compile a simple test program that
> uses <iostream.h>, Visual C++ 7 gives me this strange error:
[quoted text clipped - 13 lines]
> that cout and cin (the only iostream commands I used) were not defined. How
> can I use cout and cin without getting a compiler (or linker) error?

Chris::

std::cin, std::cout, std::endl

Or you can use

using namespace std;

But don't put it in a header.

David Wilkinson
Chris Jones - 02 Mar 2006 16:35 GMT
Thanks, problem fixed.

> > I am using the old <iostream.h>. When I compile a simple test program that
> > uses <iostream.h>, Visual C++ 7 gives me this strange error:
[quoted text clipped - 25 lines]
>
> David Wilkinson

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.