[postgis-users] How to create user-defined C function using a postgis C function

Peter Tolkewitz peter.tolkewitz at gmx.de
Mon Nov 11 03:27:17 PST 2013


Hello Sandro,
 
thank you for your answer. For testing I wrote another main() class:
 
--- start main.c ---

int main() {
  test(0,0);
  return 0;
}
--- end main.c ---
 
and compiled
 
> cc -I/usr/include/pgsql/server -fpic -shared -o libtest.so test.c
> cc -llwgeom -ltest main.c -o main -L. -L/usr/lib64
 
In /usr/lib64 the liblwgeom.so is located (a liblwgeom.a I cannot find).
 

Now the original error is resolved, but now I get
 
/usr/lib64/liblwgeom.so: undefined reference to `lwgeom_init_allocators'
 
Any ideas how to resolve this?

/Peter


 


Gesendet: Sonntag, 10. November 2013 um 20:57 Uhr
Von: "Sandro Santilli" <strk at keybit.net>
An: "PostGIS Users Discussion" <postgis-users at lists.osgeo.org>
Betreff: Re: [postgis-users] How to create user-defined C function using a postgis C function
On Sat, Nov 09, 2013 at 01:33:57PM +0100, Peter Tolkewitz wrote:

> > cc -I/usr/include/pgsql/server -fpic -c test.c
> > cc -shared -o test.so test.o

[..]

> ...complains with undefined symbol "lwgeom_clone_deep"

Add an -llwgeom line to your cc invocation,
or add full path to liblwgeom.a for static linking
(preferred by some)

--strk;
_______________________________________________
postgis-users mailing list
postgis-users at lists.osgeo.org
http://lists.osgeo.org/cgi-bin/mailman/listinfo/postgis-users


More information about the postgis-users mailing list