FW: Incompatible library : Missing Magic Block - Mailing list pgsql-general

From
Subject FW: Incompatible library : Missing Magic Block
Date
Msg-id 4AD2336877609F41A2B0D53BAD09FC579D71C8@VOO-EXCHANGE07.internal.sungard.corp
Whole thread Raw
List pgsql-general

 

One more thing to add here…I am using the Postgres 8.3.7 headers to compile my program and have added PG_MODULE_MAGIC but still error is persisting.

 

 


From: Bhattacharya, A
Sent: Thursday, October 22, 2009 10:46 AM
To: 'pgsql-general@postgresql.org'
Subject: Incompatible library : Missing Magic Block

 

 

Hi,

 

I am trying to code Postgres external C function in windows XP and am using Postgres 8.3 version.

However I have included all the required things in the code to run (Please find below the example code which I am compiling using MSVC and generating the dll)

 

_________________________________________________________________

// add.cpp : Defines the entry point for the DLL application.

//

 

#define _USE_32BIT_TIME_T

#include "postgres.h"

#include "fmgr.h"

//#ifdef PG_MODULE_MAGIC

PG_MODULE_MAGIC;

//#endif

 

PG_FUNCTION_INFO_V1(add_one);

Datum add_one(PG_FUNCTION_ARGS)

{

    int32   arg = PG_GETARG_INT32(0);

 

    PG_RETURN_INT32(arg + 1);

}

 _____________________________________________________________________

 

I could compile the code successfully and generate the dll with no errors but whenever I am compiling the below postgres functuion using the dll the it thrown an error saying

 

ERROR:  incompatible library "C:/Program Files/PostgreSQL/8.3/lib/add.dll": missing magic block

HINT:  Extension libraries are required to use the PG_MODULE_MAGIC macro.

 

Postgres Function

CREATE OR REPLACE FUNCTION add_one(IN int) RETURNS int AS '$libdir/add', 'add_one' LANGUAGE C;

 

Please provide your help at the earliest as this is really a show stopper for us.

 

pgsql-general by date:

Previous
From: "Jayaraman, Rajaram (STSD)"
Date:
Subject: FATAL error "could not find function "alt_to_mic" in file cyrillic_and_mic.so
Next
From:
Date:
Subject: Incompatible library : Missing Magic Block