[postgis-users] PostGIS and GEOS on FreeBSD 4.11: problem with libstdc++.so.6

Toomas Aas toomas.aas at raad.tartu.ee
Mon Sep 25 11:29:00 PDT 2006


Hello!

I installed the following back in June:

PostgreSQL 8.1.4
GEOS 2.2.1
PostGIS 1.1.2

All this was installed onto FreeBSD 4.11 server, using the FreeBSD ports 
collection. During installing, when I read the PostGIS documentation, I 
found the following note:

-----------------------------------------------------------------------
If you plan to use GEOS functionality you might need to explicitly link
PostgreSQL against the standard C++ library:

LDFLAGS=-lstdc++ ./configure [YOUR OPTIONS HERE]

This is a workaround for bogus C++ exceptions interaction with older
development tools. If you experience weird problems (backend 
unexpectedly closed or similar things) try this trick. This will require 
recompiling your PostgreSQL from scratch, of course.
-----------------------------------------------------------------------

It said that I *might* need to use this trick, but I couldn't figure out
how to make sure I need it, so I decided not to modify my existing 
PostgreSQL build.

Now for the first time I tried to use some simple PostGIS functionality:

select geomfromtext('') ;

The response to that was less than encouraging:

ERROR:  could not load library 
"/usr/local/lib/postgresql/liblwgeom.so.1": dlopen 
(/usr/local/lib/postgresql/liblwgeom.so.1) failed: Shared object 
"libstdc++.so.6" not found, required by "libgeos_c.so.1"
CONTEXT:  SQL function "geomfromtext" statement 1

The problem with this message is that all these library files actually 
do exist and are listed in output of 'ldconfig -r', so I don't 
understand why libstdc++.so.6 can't be found. Does this qualify as a 
"weird problem (backend unexpectedly closed or similar thing)", 
indicating that I need to rebuild PostgreSQL?

To make life even more interesting, building GEOS on FreeBSD 4.11 pulled 
in GCC 3.4 as a dependency and used that to compile itself, whereas 
PostgreSQL and PostGIS got built with GCC 2.95, which is standard in 
FreeBSD 4. So I actually have two versions of lstdc++:
/usr/lib/libstdc++.so.3
and
/usr/local/lib/gcc/i386-portbld-freebsd4.11/3.4.6/libstdc++.so.6

I wonder if I should perhaps try to build PostgreSQL and PostGIS with 
GCC 3.4, so they all use the same C++ libraries?

Thanks in advance for any ideas,

--
Toomas Aas



More information about the postgis-users mailing list