Hi fellows,
I'm getting problems compiling a trigger written in C (exactly the one
from the documentation), when compiling it I get the errore shwoned
here.
I think the problem might be the linker, but I don't know how to fix it.
The command that I run was:
gcc -I /usr/include/postgresql/server prueba1.c
And here is the error:
/usr/lib/gcc-lib/i486-linux/3.3.5/../../../crt1.o(.text+0x18): En la función `_start':
../sysdeps/i386/elf/start.S:115: undefined reference to `main'
/tmp/cc4DCNL5.o(.text+0x56): En la función `trigf':
: undefined reference to `errstart'
/tmp/cc4DCNL5.o(.text+0x6a): En la función `trigf':
: undefined reference to `elog_finish'
/tmp/cc4DCNL5.o(.text+0xd9): En la función `trigf':
: undefined reference to `SPI_connect'
/tmp/cc4DCNL5.o(.text+0x106): En la función `trigf':
: undefined reference to `errstart'
/tmp/cc4DCNL5.o(.text+0x128): En la función `trigf':
: undefined reference to `elog_finish'
/tmp/cc4DCNL5.o(.text+0x13c): En la función `trigf':
: undefined reference to `SPI_exec'
/tmp/cc4DCNL5.o(.text+0x169): En la función `trigf':
: undefined reference to `errstart'
/tmp/cc4DCNL5.o(.text+0x18b): En la función `trigf':
: undefined reference to `elog_finish'
/tmp/cc4DCNL5.o(.text+0x19f): En la función `trigf':
: undefined reference to `SPI_tuptable'
/tmp/cc4DCNL5.o(.text+0x1ab): En la función `trigf':
: undefined reference to `SPI_tuptable'
/tmp/cc4DCNL5.o(.text+0x1b8): En la función `trigf':
: undefined reference to `SPI_getbinval'
/tmp/cc4DCNL5.o(.text+0x1e1): En la función `trigf':
: undefined reference to `errstart'
/tmp/cc4DCNL5.o(.text+0x203): En la función `trigf':
: undefined reference to `elog_finish'
/tmp/cc4DCNL5.o(.text+0x208): En la función `trigf':
: undefined reference to `SPI_finish'
/tmp/cc4DCNL5.o(.text+0x22f): En la función `trigf':
: undefined reference to `SPI_getbinval'
collect2: ld devolvió el estado de salida 1
I'm running Debian-Sarge and I have postgresql, postgresql-dev,
postgresq-contrib packakes with gcc3.3, gcc3.3-base and libc6 installed
on my machine.
Any help that you can bring to me should be very helpfuly. Thanks in advance,
Rodolfo.
- [HACKERS] Problems compiling a trigger Rodolfo Campos
- Re: [HACKERS] Problems compiling a trigger Neil Conway