This is the mail archive of the
fortran@gcc.gnu.org
mailing list for the GNU Fortran project.
Re: [Fwd: Linking Problems with gcc-3.3]
Paul,
many thanks for your immediate answer.
You are right, its actually C++ code.
It works now ok, however I linked with -lfrtbegin and -lg2c
(-lgfortran was mot found), according to your help-page.
I would suggest, however, to place a hint on the man-page of g77.
In the eralier versions no extra libraries were needed for linking.
thanks and regards
wolfk
Paul Brook wrote:
>
> On Thursday 22 January 2004 9:56 am, Wolfgang Köhler wrote:
> > Hello,
> >
> > I have recently tried to update my gcc from version 2.95 -> 3.3
> > and was not able to compile an older program that links
> > Fortan with C-code. Compiling succeeds but linking fails with
> > errors:
> >
> > undefined reference to:
> > __gxx_personality_v0
> >
> > and some other undefines associated with C new-operator.
> >
> > Can you help me?
>
> Sounds like you actualy mean C++. __gxx_personality_v0 is in libsupc++, which
> might not have existed/been part of libstdc++ in gcc 2.9.5.
>
> Basically you need to link in both the c++ and fortran runtime libraries.
> Probably the easiest way to do this to link the final executable with g++ and
> add -lgfortran to link the fortran runtime.
>
> Paul
--
----------------------------------------------------------------------------
Wo bleibt die Mathe-Reform, die endlich das '=' abschafft ?
----------------------------------------------------------------------------
Wolfgang Koehler wolfk@gfz-potsdam.de
GeoForschungsZentrum Potsdam, Germany, Projekt CHAMP Tel: (0331)288-1738