Mail Archives: djgpp/2002/03/24/09:15:04
Just check out the spelling of include....
You've written #inlcude.... which is not acceptable - should have been
#include <iostream.h>.
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" <xxx AT yyy DOT com> wrote in message news:<a7gig6$rq3$07$1 AT news DOT t-online DOT com>...
> 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 <iostream.h>
> 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" <cantela AT lycos DOT com> 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
- Raw text -