Re: Compiling C function with VC++ for Windows version

From: Craig Ringer <ringerc(at)ringerc(dot)id(dot)au>
To: Edwin Quijada <listas_quijada(at)hotmail(dot)com>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: Compiling C function with VC++ for Windows version
Date: 2012-01-12 05:45:06
Message-ID: 4F0E7362.9020305@ringerc.id.au
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On 12/01/12 11:06, Edwin Quijada wrote:
> Hi!
> I am trying to create a C function for windows in Postgres compiling
> with VC++ 2008 Express Edition. I did this function for Linux without
> problem using gcc and tried to do the same in Windows but in Windows
> was imposible. The function compile fine but when I tried to run from
> Postgres it down the server in windows but in Linux the same function
> run perfect.

You haven't provided enough information for anyone to help you.

How are you compiling your function? Using pgxs, or some other way?

What's the full source code of the function?

Where does the server crash when it crashes? You might need to get a
backtrace of the server crash to help you figure out why your function
crashes it. See this documentation on getting a backtrace of a Pg
backend under windows:

http://wiki.postgresql.org/wiki/Getting_a_stack_trace_of_a_running_PostgreSQL_backend_on_Windows

>
> The function just try to get a string value and pass to postgres.
> Reading somebody told me that I need to compile the function using
> VC++ not gcc in Windows so I downloaded VC++ 2008 Express but I dont
> know what directives compilation I need as gcc in windows and Linux.

If you are using a standard binary distribution of PostgreSQL then yes,
you should use Visual C++, preferably the same version of Visual C++
that was used for that version of PostgreSQL. Specify your version of Pg.

--
Craig Ringer

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Yan Chunlu 2012-01-12 08:47:03 select statment going slow and slow while using IN (xx,xx)
Previous Message debian nick 2012-01-12 05:16:04 Postgresql allow connections without password