Re: function compiled with g++

Поиск
Список
Период
Сортировка
От Thomas Lockhart
Тема Re: function compiled with g++
Дата
Msg-id 3BAECCBD.2D878E84@fourpalms.org
обсуждение исходный текст
Ответ на function compiled with g++  (Boris Pran <boris.pran@finteh.hr>)
Список pgsql-general
> Why the same function writen in C, compiled with gcc works OK, but compiled
> with g++, doesn't even load? Not mentioning those written in C++.
> i.e. loader reports undefined symbol: pg_detoast_datum__FP7varlena or some
> other undefined symbol...

C++ compilers do "name mangling" to allow function overloading. If you
are going to call a C++ routine from C or most other languages, you need
to wrap the declaration for the called function in the following:

  extern "C" {
    retval your_function_here(arg1,arg2);
  }

hth

                       - Thomas

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

Предыдущее
От: Boris Pran
Дата:
Сообщение: function compiled with g++
Следующее
От: Jeff Davis
Дата:
Сообщение: Re: function compiled with g++