I've changed:

#ifdef PG_MODULE_MAGIC
PG_MODULE_MAGIC;
#endif

to:

#define PG_MODULE_MAGIC ;

and the .so does compile, but the database is still reporting the same
error when i try to CREATE FUNCTION:

ERROR:  incompatible library "/home/mario/tests/psql_c_func/
test_func.so": missing magic block
HINT:  Extension libraries are required to use the PG_MODULE_MAGIC
macro.

I searched for all fmgr.h files in the /usr and i got the output:

/usr/local/include/postgresql/server/storage/bufmgr.h
/usr/local/include/postgresql/server/fmgr.h
/usr/local/include/postgresql/server/fmgr.h.gch
/usr/local/pgsql/include/server/storage/bufmgr.h
/usr/local/pgsql/include/server/fmgr.h

So there obviously are more headers on the system, but i've tried to
compile the .so with the second and the last one. Both time the same
result.



Tom Lane je napisal:
> Mario Munda <[EMAIL PROTECTED]> writes:
> > I had to comment some includes out, or else i get some errors.
>
> Perhaps you are compiling against an old or incomplete set of
> Postgres header files?
>
> > #ifdef PG_MODULE_MAGIC
> > PG_MODULE_MAGIC;
> > #endif
>
> The problem with that coding is that it will silently not produce
> a magic block if you are compiling against pre-8.2 Postgres headers.
> If you remove the #ifdef protection does it still compile?
>
>                       regards, tom lane
>
> ---------------------------(end of broadcast)---------------------------
> TIP 5: don't forget to increase your free space map settings


---------------------------(end of broadcast)---------------------------
TIP 1: if posting/reading through Usenet, please send an appropriate
       subscribe-nomail command to [EMAIL PROTECTED] so that your
       message can get through to the mailing list cleanly

Reply via email to