Re: Missing magic block - Mailing list pgsql-general

From Mario Munda
Subject Re: Missing magic block
Date
Msg-id 1178868420.304740.143250@q75g2000hsh.googlegroups.com
Whole thread Raw
In response to Re: Missing magic block  (Tom Lane <tgl@sss.pgh.pa.us>)
Responses Re: Missing magic block
List pgsql-general
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 <mario.munda@gmail.com> 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


pgsql-general by date:

Previous
From: Gregory Stark
Date:
Subject: Re: stuck on values in 8.2
Next
From: Jerry
Date:
Subject: Re: xml to db converter