Opened 22 years ago

Closed 21 years ago

Last modified 21 years ago

#246 closed defect (fixed)

Problems with GCC 3.x

Reported by: dmorissette Owned by: dmorissette
Priority: high Milestone:
Component: Command Line Utilties Version: 4.0
Severity: normal Keywords:
Cc: pbaker@…, mathias.jaekel@…

Description

> The other problem had to do with the gcc 3.2 compiler which is installed by
> default (the gcc 2.9 compiler is available in the Mandrake 9.0 distribution
> also). Norman Vine posted a work around for the 3.2 compiler: After you
> ./configure, edit your Makefile and locate the line:
>      "STATIC_LIBS= $(GD_STATIC) $(OGR_STATIC)"
> and add " -lstdc++" at the end, so it should look like:
>      "STATIC_LIBS= $(GD_STATIC) $(OGR_STATIC) -lstdc++"
> 


Others have recommended using 'c++' as the linker instead of ld or gcc.  We'll 
have to investigate and fix the configure script.

Attachments (1)

246.patch (429 bytes ) - added by pbaker@… 21 years ago.
fix to configure.in

Download all attachments as: .zip

Change History (9)

comment:1 by dmorissette, 22 years ago

Subject: Re: [Mapserver-users] MDK9 (gcc3): undefined reference to 
`__gxx_personality_v0'
   Date: Thu, 2 Jan 2003 15:52:19 -0500
   From: "Norman Vine" <nhv@cape.com>
     To: "richard hornsby" <rhornsby@io.osuedc.org>, 
<mapserver-users@lists.gis.umn.edu>

richard hornsby writes:
>
> ref gcc version 3.2 (Mandrake Linux 9.0 3.2-1mdk)
> ref mapserver 3.6.3
> 
> Checking the mailing list archives and realizing that this seems to be a
> common problem with GCC 3 not understanding what 'personality_v0' is or
> whatever, and seeing all the stuff about changing the makefile to point to
> g++ in the problem areas, what I can't figure out is:
> 
>  - what lines (by number if possible) in the Makefile need to be changed,
> so that those who are trying aren't changing the wrong lines?
> 
>  - does it actually do anything to change lines in the Makefile to point
> to g++ in linux?  ie, I get the same version response whether I ask 'gcc
> -v' or 'g++ -v'?

this keeps coming up so I hope the following can be used as
the basis for a FAQ entry  or even better for changes to be 
made in the mapserver Makefile 
  < please clean up as necessary >

g++ and c++ are just driver programs that call the actual compiler
g++ automatically links with -lstdc++ whereas gcc does not

so since the some of the libraries mapserver link with are C++
libraries you need to link with libstdc++ to link successfuly 

You can accomplish this  by either 

1) changing the Makefile so that g++ is called for the linking stage
    of the mapserver executables

2) adding -lstdc++ to the list of libraries thesse executables are
    linked against
 
>  - is it possible to install and use gcc 2.9.x concurrently with gcc 3.x,
> and therefore compile mapserver with the gcc 2.9.x, all *without*
> breaking the existing installation of gcc 3.x?  if so, could someone point
> out where the documentation on howto do this is?

http://gcc.gnu.org/fom_serv/cache/14.html

HTH

Norman

comment:2 by dmorissette, 22 years ago

Cc: mathias.jaekel@… added

comment:3 by dmorissette, 22 years ago

*** Bug 263 has been marked as a duplicate of this bug. ***

comment:4 by sdlime, 21 years ago

Resolution: fixed
Status: newclosed
A suggestion (and a rather simple one at that) seems to have fixed the problem.

Steve

by pbaker@…, 21 years ago

Attachment: 246.patch added

fix to configure.in

comment:5 by pbaker@…, 21 years ago

Resolution: fixed
Status: closedreopened
I'm reopening this bug in hopes that someone will include it in the upstream source.

comment:6 by pbaker@…, 21 years ago

Cc: pbaker@… added

comment:7 by dmorissette, 21 years ago

Cc: steve.lime@… added
Resolution: fixed
Status: reopenedclosed
Fixed.  I have applied the patch to the 3.6 branch as well (it was applied only 
to the 4.0 main trunk before).

This will be part of an upcoming 3.6.6 release... actually, I think there are a 
few fixes that would warrant that we release 3.6.6 now, I'll contact Steve Lime 
about this and cvs-tag the source in preparation for a release.

comment:8 by pbaker@…, 21 years ago

sweet now I've officially contributed to mapserver. :-)
Note: See TracTickets for help on using tickets.