Re: Linker errors while creating a PostgreSQL C extension function.

Поиск
Список
Период
Сортировка
От Dmitry Igrishin
Тема Re: Linker errors while creating a PostgreSQL C extension function.
Дата
Msg-id CAAfz9KN2QVzpDvq5renau2rEQoE6hFKscWRu+-5CCSe_0qiXsA@mail.gmail.com
обсуждение исходный текст
Ответ на Re: Linker errors while creating a PostgreSQL C extension function.  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-general
вс, 19 авг. 2018 г. в 17:54, Tom Lane <tgl@sss.pgh.pa.us>:
>
> Dmitry Igrishin <dmitigr@gmail.com> writes:
> > вс, 19 авг. 2018 г. в 16:20, TalGloz <glozmantal@gmail.com>:
> >> I'll try it later when I'm home. Is there a reason that you are linking like
> >> this
> >> $(CXX) -Wl,--no-undefined -shared -o seal_diff_cpp.so $(LDFLAGS) $(LDLIBS)
> >> seal_diff_cpp.o
> >> And not like this?
> >> $(CXX) -Wl,--no-undefined -shared -o seal_diff_cpp.so seal_diff_cpp.o
> >> $(LDFLAGS) $(LDLIBS)
>
> > If I recall correctly there were some problems with ordering arguments
> > of the linker that are specified upon calling g++.
>
> You're creating such problems, not solving them, if you put the library
> first.  Particularly with .a-style libraries, you *must* list the
> referencing .o file first, or the linker will deem the library
> unreferenced and unnecessary.
Ah, I thought just the opposite :-) ! Since I use CMake I forget this
subtlety. Thank you for pointing this out!


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

Предыдущее
От: TalGloz
Дата:
Сообщение: Re: Linker errors while creating a PostgreSQL C extension function.
Следующее
От: "Daniel Verite"
Дата:
Сообщение: Re: Linker errors while creating a PostgreSQL C extension function.