Re: Compiling C function with VC++ for Windows version - Mailing list pgsql-general

From Craig Ringer
Subject Re: Compiling C function with VC++ for Windows version
Date
Msg-id 4F0FD2C8.1000801@ringerc.id.au
Whole thread Raw
In response to Re: Compiling C function with VC++ for Windows version  (Edwin Quijada <listas_quijada@hotmail.com>)
Responses Re: Compiling C function with VC++ for Windows version  (Edwin Quijada <listas_quijada@hotmail.com>)
List pgsql-general
On 13/01/2012 1:55 AM, Edwin Quijada wrote:
>
> Ok.
> This is the way that I compile.
> Linux this way works fine and I use the modules compiled. of course,
> Linux I compile from source and I use gcc.

Yep... but Windows isn't Linux.

In particular, the distributions of PostgreSQL for Windows are compiled
using Microsoft Visual C++, not gcc. It is possible to use gcc (mingw)
to compile shared libraries that are compatible with programs compiled
with MSVC++ but I've generally found it simpler to just use MSVC++ to
compile libraries on Windows.

If you prefer to use mingw there's still usually no problem with that,
you'll just have to figure out why your function is crashing the server.
Things to try:

- Delete code until it stops crashing; or
- Get a backtrace of the server to see where it crashes and why.

See how I'm repeating "get a backtrace of the crash"? Check out the link
I sent in my last post for info on how to do it using windbg or vc++
express.

--
Craig Ringer

pgsql-general by date:

Previous
From: Craig Ringer
Date:
Subject: Re: Operator based on data type
Next
From: Chris Angelico
Date:
Subject: Re: Operator based on data type