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

Поиск
Список
Период
Сортировка
Искать
От
Laurenz Albe
Тема
Re: Linker errors while creating a PostgreSQL C extension function.
Дата
Msg-id
d1f46930cf916f0afbfeb52185169b9a9049a1d0.camel@cybertec.at
Ответ на
Список
Дерево обсуждения
Linker errors while creating a PostgreSQL C extension function. TalGloz <glozmantal@gmail.com>
Re: Linker errors while creating a PostgreSQL C extension function. Dmitry Igrishin <dmitigr@gmail.com>
Re: Linker errors while creating a PostgreSQL C extension function. TalGloz <glozmantal@gmail.com>
Re: Linker errors while creating a PostgreSQL C extension function. "Daniel Verite" <daniel@manitou-mail.org>
Re: Linker errors while creating a PostgreSQL C extension function. TalGloz <glozmantal@gmail.com>
Re: Linker errors while creating a PostgreSQL C extension function. "Daniel Verite" <daniel@manitou-mail.org>
Re: Linker errors while creating a PostgreSQL C extension function. TalGloz <glozmantal@gmail.com>
Re: Linker errors while creating a PostgreSQL C extension function. Tom Lane <tgl@sss.pgh.pa.us>
Re: Linker errors while creating a PostgreSQL C extension function. TalGloz <glozmantal@gmail.com>
Re: Linker errors while creating a PostgreSQL C extension function. Laurenz Albe <laurenz.albe@cybertec.at>
Re: Linker errors while creating a PostgreSQL C extension function. TalGloz <glozmantal@gmail.com>
Re: Linker errors while creating a PostgreSQL C extension function. Dmitry Igrishin <dmitigr@gmail.com>
Re: Linker errors while creating a PostgreSQL C extension function. TalGloz <glozmantal@gmail.com>
Re: Linker errors while creating a PostgreSQL C extension function. Dmitry Igrishin <dmitigr@gmail.com>
Re: Linker errors while creating a PostgreSQL C extension function. TalGloz <glozmantal@gmail.com>
Re: Linker errors while creating a PostgreSQL C extension function. Dmitry Igrishin <dmitigr@gmail.com>
Re: Linker errors while creating a PostgreSQL C extension function. TalGloz <glozmantal@gmail.com>
Re: Linker errors while creating a PostgreSQL C extension function. Dmitry Igrishin <dmitigr@gmail.com>
Re: Linker errors while creating a PostgreSQL C extension function. Tom Lane <tgl@sss.pgh.pa.us>
Re: Linker errors while creating a PostgreSQL C extension function. TalGloz <glozmantal@gmail.com>
Re: Linker errors while creating a PostgreSQL C extension function. Dmitry Igrishin <dmitigr@gmail.com>
TalGloz wrote:
> Do you or anyone know why is it trying to link with -L/usr/lib64 path and
> not -L/usr/local/lib as provided?
> 
> After recompiling the libseal.a with the -fPIC flag and copying it manually
> from /usr/local/lib/ to /usr/lib64/ I get those errors:
> 
> g++ -Wl,--no-undefined -shared -o seal_diff_cpp.so seal_diff_cpp.o
> -L/usr/pgsql-10/lib   -L/usr/lib64 -Wl,--as-needed
> -Wl,-rpath,'/usr/pgsql-10/lib',--enable-new-dtags -L/usr/local/lib -lseal
> -pthread
> seal_diff_cpp.o: In function `seal_diff_cpp':
> /etc/opt/pgsql_c_functions/CPP/seal_extension/seal_diff_cpp.cpp:106:
> undefined reference to `pg_detoast_datum_packed'
> /etc/opt/pgsql_c_functions/CPP/seal_extension/seal_diff_cpp.cpp:107:
> undefined reference to `pg_detoast_datum_packed'
> /etc/opt/pgsql_c_functions/CPP/seal_extension/seal_diff_cpp.cpp:108:
> undefined reference to `pg_detoast_datum_packed'
> /etc/opt/pgsql_c_functions/CPP/seal_extension/seal_diff_cpp.cpp:112:
> undefined reference to `text_to_cstring'
> /etc/opt/pgsql_c_functions/CPP/seal_extension/seal_diff_cpp.cpp:113:
> undefined reference to `text_to_cstring'
> /etc/opt/pgsql_c_functions/CPP/seal_extension/seal_diff_cpp.cpp:114:
> undefined reference to `text_to_cstring'
> /etc/opt/pgsql_c_functions/CPP/seal_extension/seal_diff_cpp.cpp:130:
> undefined reference to `cstring_to_text_with_len'
> 
> Did I miss something in one of my files?

I think the --no-undefined is wrong.

Any reference to PostgreSQL functions is undefined at build time and
gets resolved when the shared library is loaded into PostgreSQL.

Yours,
Laurenz Albe
-- 
Cybertec | https://www.cybertec-postgresql.com


В списке pgsql-general по дате отправления
От: Wu Ivy
Дата:
Сообщение: SPI_cursor_fetch Memory Issue
От: imp3
Дата:
FAQ