Обсуждение: How to include pgsql static libraries in your own app written in Xcode?

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

How to include pgsql static libraries in your own app written in Xcode?

От
"Peter K. Stys"
Дата:
I am trying to write a plugin (for REALbasic) in C using Xcode on Mac OS X.  I have succeeded except that my plugin depends on dylibs that must be installed on each client machine.

I'd like to create a plugin with all pgsql libs statically linked into my plugin to create a standalone solution.

I've added the libpq.a library and included libpq-fe.h and postgres_ext.h that it needs.  The linker reports a bunch of errors:

  "_BIO_free", referenced from:
      _client_cert_cb in libpq.a(fe-secure.o)
      _client_cert_cb in libpq.a(fe-secure.o)
      _client_cert_cb in libpq.a(fe-secure.o)
      _client_cert_cb in libpq.a(fe-secure.o)

etc...

I'm sure this is a straighfwd issue, but I have no idea what to try to fix this and link in the libraries to my plugin.

Any pointers would be greatly appreciated,
Regards,
Peter.


--
---------------------------------------------
Peter K. Stys, MD
Dept. of Clinical Neurosciences
Hotchkiss Brain Institute
University of Calgary
tel (403) 210-8646
---------------------------------------------

Re: How to include pgsql static libraries in your own app written in Xcode?

От
Tom Lane
Дата:
"Peter K. Stys" <pkstys@gmail.com> writes:
> I'd like to create a plugin with all pgsql libs statically linked into my
> plugin to create a standalone solution.

> I've added the libpq.a library and included libpq-fe.h and postgres_ext.h
> that it needs.  The linker reports a bunch of errors:

>   "_BIO_free", referenced from:

I believe that's openssl code.  Unless you also have static libraries
for openssl, and any other libraries you've compiled libpq to depend on,
there is no hope of making a self-contained executable.

FWIW, most people realized that monolithic statically-linked executables
are a terrible idea about ten years ago.  You have no idea the amount of
maintenance pain you are setting up for yourself and your users.
Do you really want to relink Postgres every time there's an openssl
security update?

            regards, tom lane