Re: unresolved externals when linking app with libpq

From: eljot <eljot(at)elkomtech(dot)com(dot)pl>
To: pgsql-interfaces(at)postgresql(dot)org
Subject: Re: unresolved externals when linking app with libpq
Date: 2005-06-29 11:22:46
Message-ID: 42C28486.1060807@elkomtech.com.pl
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-interfaces

Tom Lane wrote:

>eljot <eljot(at)elkomtech(dot)com(dot)pl> writes:
>
>
>>I was able to link my postgresql apps successfully when I was using
>>PostgreSQL version 8.0.1 or earlier. Now (v. 8.0.3) the linker tells me
>>there is many unresolved externals.
>>
>>
>Apparently you've configured the new Postgres build with SSL and
>Kerberos support, which you didn't have in your 8.0.1 build.
>
No, I didn't change anything. The only thing I did is I had copied the
proper .h files and libpq.a file to specified directories on my
development machine. I must compile my apps for various versions of
postgres (and some other rdbms as well) in the same time, so I can't
directly use c-interface files installed by postgresql itself. I didn't
change my makefile at all. So I think the problem may be with
compilation of files included in new version of libpq.a (PostgreSQL
8.0.3 from FC4).

>[...]
>Alternatively, look at psql with ldd to find out what libraries it
>depends on.
>
>
Thanks a lot, it was really helpful. If anybody is interested in this is
a part of command for linker which has given me a success:

-lpq -lpam -lssl -lcrypto -lkrb5 -lz -lreadline -ltermcap -lcrypt
-lresolv -lnsl -ldl -lpthread -lgssapi_krb5 -lcom_err -lk5crypto
-lkrb5support -lgcc_eh

For postgresql 8.0.1 and earlier linking only with with -lpq was sufficient.

The executable file growed fom 1.0MB (8.0.1) to 2.3MB (8.0.3) and I'm
afraid it may not work without recompiling under other Linux
distributions (I will test it's behaviour on FC3, RH9 & SUSE 9.3 soon)
due to many additional shared libraries used. So I'd like to get rid of
extra libs if it is possible of course, and still have no idea how to do
this.

Than's again for your help.

> regards, tom lane
>
>
>

--
Regards
Jarek Lubczynski

There are 10 kinds of people:
Those who understand binary and those who don't

In response to

Browse pgsql-interfaces by date

  From Date Subject
Next Message Murray Cumming 2005-07-01 07:26:46 Re: Driver for Gnome/GTK Applications.....
Previous Message Tom Lane 2005-06-28 14:01:25 Re: unresolved externals when linking app with libpq 8.03