Обсуждение: Perl modules problem on OS X

Поиск
Список
Период
Сортировка

Perl modules problem on OS X

От
Alex Rice
Дата:
Hello, please let me know if this is not the most appropriate
forum for this question. I am stumped and have already asked on
the mapserver-users and macosx-perl mailing lists.

Mac OS X 10.1.5
PostgreSQL 7.2.1
PostGIS 7.1
Perl 5.6.0 (standard OS X Perl)
Mapserver (CGI)
Mapscript (Perl module, Minnesota Mapserver, generated with
latest SWIG 1.3)

Mapscript connects to PostGIS data sources just fine.  However, I
also need to connect via DBI or Pg to my PostgreSQL database for
other queries.

# this script
use mapscript;
use DBI;
DBI->data_sources('Pg');

# dies with
dyld: perl multiple definitions of symbol _DLAddHead
/Library/Perl/darwin/auto/mapscript/mapscript.bundle definition
of _DLAddHead
/Library/Perl/darwin/auto/DBD/Pg/Pg.bundle definition of _DLAddHead

The strange thing is, of the 3 modules DBI, Pg and mapscript, all
3 work OK independently, but when I use;  any two them from the
same script, the above symbol definitions problem occurs and the
script dies.

At first I thought it was a mapscript problem, but I don't think
so. For instance this one dies as well, not that one would use it
in real life:


use DBI;
use Pg;
DBI->data_sources('Pg');

dyld: perl multiple definitions of symbol _DLAddHead
/Library/Perl/darwin/auto/Pg/Pg.bundle definition of _DLAddHead
/Library/Perl/darwin/auto/DBD/Pg/Pg.bundle definition of _DLAddHead

Alex Rice, Software Developer
Architectural Research Consultants, Inc.
alex_rice@arc.to
alrice@swcp.com



Re: Perl modules problem on OS X

От
Tom Lane
Дата:
Alex Rice <alex_rice@arc.to> writes:
> dyld: perl multiple definitions of symbol _DLAddHead
> /Library/Perl/darwin/auto/mapscript/mapscript.bundle definition
> of _DLAddHead
> /Library/Perl/darwin/auto/DBD/Pg/Pg.bundle definition of _DLAddHead

> The strange thing is, of the 3 modules DBI, Pg and mapscript, all
> 3 work OK independently, but when I use;  any two them from the
> same script, the above symbol definitions problem occurs and the
> script dies.

Hm.  It would appear that all three modules have copies of libpq.a
statically bound into them, and OS X's dynamic loader won't accept
loading dynamic libraries with conflicting symbol names.

DLAddHead is presumably just the first conflict the loader ran into
--- if you got rid of that, it'd still fail on PQExec and the other
symbols exported by libpq.

I imagine that this can be worked around by changing the way that
these modules are linked, but I really have no idea exactly what has
to be done or by whom.  You might try asking around among OSX gurus
about what to do with name conflicts between libraries.

            regards, tom lane

Re: Perl modules problem on OS X

От
Alex Rice
Дата:
On Wednesday, August 14, 2002, at 04:07  PM, Tom Lane wrote:

> Alex Rice <alex_rice@arc.to> writes:
>> dyld: perl multiple definitions of symbol _DLAddHead
>> /Library/Perl/darwin/auto/mapscript/mapscript.bundle definition
>> of _DLAddHead
>> /Library/Perl/darwin/auto/DBD/Pg/Pg.bundle definition of _DLAddHead
>
>> The strange thing is, of the 3 modules DBI, Pg and mapscript, all
>> 3 work OK independently, but when I use;  any two them from the
>> same script, the above symbol definitions problem occurs and the
>> script dies.
>
> Hm.  It would appear that all three modules have copies of libpq.a
> statically bound into them, and OS X's dynamic loader won't accept
> loading dynamic libraries with conflicting symbol names.
>
> DLAddHead is presumably just the first conflict the loader ran into
> --- if you got rid of that, it'd still fail on PQExec and the other
> symbols exported by libpq.
>
> I imagine that this can be worked around by changing the way that
> these modules are linked, but I really have no idea exactly what has
> to be done or by whom.  You might try asking around among OSX gurus
> about what to do with name conflicts between libraries.

OK I managed to get DBD::Pg to link dynamically and I'm no longer
getting the error. DBD::Pg seemed to insist on linking with
libpq.a, so I hid libpq.a and then it linked with libpq.so,
apparently. No more errors!

Alex Rice, Software Developer
Architectural Research Consultants, Inc.
alex_rice@arc.to
alrice@swcp.com