X-Authentication-Warning: delorie.com: mailnull set sender to djgpp-bounces using -f From: kgangakhedkar AT softhome DOT net (Kunal Gangakhedkar) Newsgroups: comp.os.msdos.djgpp Subject: Re: can't include iostream.h! <<< similar problem Date: 24 Mar 2002 06:05:51 -0800 Organization: http://groups.google.com/ Lines: 85 Message-ID: <9b84a27b.0203240605.2678da9c@posting.google.com> References: NNTP-Posting-Host: 203.199.166.52 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8bit X-Trace: posting.google.com 1016978751 27961 127.0.0.1 (24 Mar 2002 14:05:51 GMT) X-Complaints-To: groups-abuse AT google DOT com NNTP-Posting-Date: 24 Mar 2002 14:05:51 GMT To: djgpp AT delorie DOT com DJ-Gateway: from newsgroup comp.os.msdos.djgpp Reply-To: djgpp AT delorie DOT com Just check out the spelling of include.... You've written #inlcude.... which is not acceptable - should have been #include . If all the environmental variables are set properly - as you're saying - then this could only be the problem, you didn't have to move libstdc++.a anywhere. The environmental vars will take care of it. So make sure absolutely that they are properly working. Your program looks fine.... One suggestion :- C++ allows main to return void. So use it if you don't want main to return the status to the OS. It is a much cleaner way. Kunal (kgangakhedkar AT softhome DOT net) "OVERHEAT" wrote in message news:... > Hello folks... > I am completly new to c++ programming, and i decided to start out with djgpp > and some basic tutorials... > So I downloaded the most recent distribution of DJGPP from the official > homepage using Zip-Picker. > after installation in solving the first compilation problems i had to face > the same problem as discussed here. > When trying to link the following program > > #inlcude > int main (void) { > cout << "Hello World"; > return 0; > } > > the linker returns the following messages > Creating: aout.exe > Error: test.o: In function 'main': > test.cpp(3) Error: undefined reference to 'cout' > Error: test.cpp(.text+0x27): undefined reference to > 'ostream::operator<<(char const*)' > Error: test.o(.eh_frame+0x11):test.cpp: undefined reference to > '___gxx_personality_v0' > Error: collect2: ld returned 1 exit status > There were some errors > > The prior compilation process works fine... > After having read this news thread I thought I could fix that by moving that > mentioned file libstcxx.a somewhere else... > So I searched for it.. and oops... it isnt there... > mhhm... now I am quite sure that i d/l ed all files suggested by zip-picker, > and I have them all installed... > When trying to compile a prog that does not employ iostream.h everything > works flawlessly... > I think I could solve that myself´, but I am simply not skilled enough in > c++. So I have to ask the experts in this NG. > What the hecks going on there...? I suppose it is a file missing... where > can I obtain this file?... Of course I could be wrong... > Hope you dont feel bothered by such simple newbie questions... > > thanks in advance > manuel > > p.s.: some additional information: OS: win xp, using rhide, environment > variables correctly set, the programm has been saved to test.cpp > > > > > "Jason R Kuntz" schrieb im Newsbeitrag > news:MENKPINLJKMHMBAA AT mailcity DOT com... > > > > -- > > Thank you, Anton! I thought it was obvious from the beginning that > > the problem was linkage, but didn't know how to fix it. Anyway, you > > were right, there was an extra (and outdated) libstdcxx.a, and when i > > moved it, i could suddenly use iostream! I can't tell you how much > > easier this will make programming (printf was getting old ;)! > > > > Thanks again! > > Jason > > > > > > > > 2,000,000,000 Web Pages--you only need 1. Save time with My Lycos. > > http://my.lycos.com