[postgis-users] writing function using C

Paragon Corporation lr at pcorp.us
Wed Mar 11 17:40:24 PDT 2009

Since this looks like a standard PostgreSQL c function, you might have more
luck asking this question in PostgreSQL general mailing list.


From: postgis-users-bounces at postgis.refractions.net
[mailto:postgis-users-bounces at postgis.refractions.net] On Behalf Of eehab
Sent: Wednesday, March 11, 2009 7:16 AM
To: postgis-users at postgis.refractions.net
Subject: [postgis-users] writing function using C

Dear  all,

I try to compile the code below to  dynamic library, the  problem if i
declare the variable type to anything else int32, i recieve the error as
below, any body have experience in writing functions using c

i use VC++ 6.

Kind regards


extern "C" {
Datum add_one(PG_FUNCTION_ARGS) {
    float8 arg = PG_GETARG_FLOAT8(0);
 float8 arg1 = PG_GETARG_FLOAT8(1);

    PG_RETURN_FLOAT8(arg + arg1);

--------------------Configuration: eehab - Win32 Release--------------------
   Creating library Release/eehab.lib and object Release/eehab.exp
eehab.obj : error LNK2001: unresolved external symbol _Float8GetDatum
Release/eehab.dll : fatal error LNK1120: 1 unresolved externals
Error executing link.exe.

eehab.dll - 2 error(s), 0 warning(s)


check out the rest of the Windows LiveT. More than mail-Windows LiveT goes
way beyond your inbox. More than messages
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/postgis-users/attachments/20090311/50e9d198/attachment.html>

More information about the postgis-users mailing list