Re: BUG #14215: External C function link failed on Mac OSX

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: BUG #14215: External C function link failed on Mac OSX
Дата
Msg-id 24492.1466954575@sss.pgh.pa.us
обсуждение исходный текст
Ответ на BUG #14215: External C function link failed on Mac OSX  (max.fomitchev@gmail.com)
Список pgsql-bugs
max.fomitchev@gmail.com writes:
> Linking:
> c++ -shared -o ttt.dylib main.o

This is not a PG bug. Having said that, the above is never going to
work on OS X; it has its own ideas about how to do things.  Instead
of "-shared" you need "-bundle -bundle_loader /path/to/postgres",
and there are some other linker flags that are advisable too.
Also, PG expects the file extension for loadable modules to be .so
even on OSX.

It's usually better to use PGXS to build extensions, instead of
learning such details for yourself:
https://www.postgresql.org/docs/9.5/static/extend-pgxs.html
Or you can crib from one of the extensions in the contrib/
source tree.

            regards, tom lane

В списке pgsql-bugs по дате отправления:

Предыдущее
От: max.fomitchev@gmail.com
Дата:
Сообщение: BUG #14215: External C function link failed on Mac OSX
Следующее
От: Tom Lane
Дата:
Сообщение: Re: BUG #14210: filter by "=" constraint doesn't work when hash index is present on a column