Re: c function - undefined symbols

From: "Albe Laurenz" <laurenz(dot)albe(at)wien(dot)gv(dot)at>
To: "Steffn *EXTERN*" <steffn(at)gmx(dot)at>, <pgsql-general(at)postgresql(dot)org>
Subject: Re: c function - undefined symbols
Date: 2008-12-10 13:39:46
Message-ID: D960CB61B694CF459DCFB4B0128514C202D67B57@exadv11.host.magwien.gv.at
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Steffn wrote:
> I am currently trying my first steps in writing my own functions in C. I
> read through the documentation and tried the most simple examples as shown in
> <http://www.postgresql.org/docs/8.3/static/xfunc-c.html>. Sadly
> this was already the point where I stumbled. I luckily compiled and
> tested the add_one integer variant. But as soon as I added the
> add_one_float8 I couldn't link no more. My linker dies with.
>
> Undefined symbols:
> "_Float8GetDatum", referenced from:
> _add_one_float8 in foo.o
> ld: symbol(s) not found
> collect2: ld returned 1 exit status
>
> Following the documentation I only added
> "/Library/PostgreSQL/8.3/include/**" to my header search path. What else
> do I need to configure?

I guess that the include path you need is /Library/PostgreSQL/8.3/include/server.

Where in the documentation did you find the path?
I read the following in
http://www.postgresql.org/docs/8.3/static/xfunc-c.html#AEN40954

"Use pg_config --includedir-server to find out where the
PostgreSQL server header files are installed on your system"

What is the result of "pg_config --includedir-server" for you?

Yours,
Laurenz Albe

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Alexander Farber 2008-12-10 13:41:30 8.2.6 -> 8.1.11: syntax error at or near "OWNED BY"
Previous Message Mark Morgan Lloyd 2008-12-10 13:10:58 Getting text into a table