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

Sandro Santilli strk at keybit.net
Mon Nov 11 03:29:35 PST 2013


On Mon, Nov 11, 2013 at 12:27:17PM +0100, Peter Tolkewitz wrote:
> 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?

As of PostGIS 2.0.x you need to provide that function in your own library,
if you switch to PostGIS 2.1.x you'll have a different requirement, due to:

  - #2089, liblwgeom: lwgeom_set_handlers replaces lwgeom_init_allocators.

--strk;


More information about the postgis-users mailing list