compiling extension functions? (fwd)
От | Tripp Lilley |
---|---|
Тема | compiling extension functions? (fwd) |
Дата | |
Msg-id | Pine.LNX.3.95.980211144035.32115Y-100000@mail.perspex.com обсуждение исходный текст |
Список | pgsql-hackers |
I posted this to questions a few days back but got no response. Can anyone here help me with this? I know it should be straightforward, and that I'm missing something obvious, but precisely *what* I'm missing is unknown to me. Thanks! - t. ----------------------------------------------------------------------- Tripp Lilley, Perspex Imageworks, Inc. (tripp.lilley@perspex.com) ----------------------------------------------------------------------- "Give me a fast computer, for I intend to go in harm's way" - updating John Paul Jones ---------- Forwarded message ---------- Date: Mon, 9 Feb 1998 12:42:48 -0500 (EST) From: Tripp Lilley <tlilley@perspex.com> To: pgsql-questions@postgresql.org Subject: compiling extension functions? I'm trying to compile and use a 'C' extension function for PG 6.2.1 under Red Hat Linux 4.2 (stock distribution). I am executing the following commands to compile my shared library and install my function, but I get "Unable to resolve symbol" when I try to execute the function. > gcc -fpic -shared salmon.c -o salmon.so -L/usr/lib -lpq -I/usr/include/postgres > touch salmon.sql > psql -d nim_0_01 -f salmon.sql drop function salmon (int4); DROP create function salmon (int4) returns char16 as '/home/tlilley/projects/perspex/scratch/nim/salmon.so' language 'c'; CREATE EOF > psql -d nim_0_01 nim_0_01=> select salmon( 42 ); WARN:Load of file /home/tlilley/projects/perspex/scratch/nim/salmon.so failed: Unable to resolve symbol nim_0_01=> And here's the source for my function: #include <postgres.h> #include <utils/palloc.h> char16 * salmon (int4 value) { char16 * buffer = (char16 *) palloc( sizeof( char16 ) ); memset( (void *) buffer, 0, sizeof( char16 ) ); (void) strncpy( buffer, "hello", 16 ); return( buffer ); } Any help (especially 'working' compile command-lines) would be great! Thanks... - t. ----------------------------------------------------------------------- Tripp Lilley, Perspex Imageworks, Inc. (tripp.lilley@perspex.com) ----------------------------------------------------------------------- "Give me a fast computer, for I intend to go in harm's way" - updating John Paul Jones
В списке pgsql-hackers по дате отправления: