Re: [GENERAL] Problem compiling a C function on Windows - not finding _palloc0@4 - Mailing list pgsql-general

From Dan Cooperstock at Software4Nonprofits
Subject Re: [GENERAL] Problem compiling a C function on Windows - not finding _palloc0@4
Date
Msg-id 007d01d30af4$e9400020$bbc00060$@software4nonprofits.com
Whole thread Raw
In response to [GENERAL] Problem compiling a C function on Windows - not finding _palloc0@4  ("Dan Cooperstock at Software4Nonprofits" <info@software4nonprofits.com>)
List pgsql-general

OK, I fixed it by changing to a 64-bit compile, which was necessary anyways because it has to work with a 64-bit install of PostgreSQL.

 

I’m still curious about how I would have fixed that if I needed the 32-bit version though.

 

--------------------------------------------------------

Dan Cooperstock
DONATION and ACCOUNTS web site: http://www.Software4Nonprofits.com
Email: info@Software4Nonprofits.com
Phone: 416-423-7722
Mail: 57 Gledhill Ave., Toronto ON M4C 5K7, Canada

If you do not want to receive any further emails from Software4Nonprofits, please reply to this email with the subject line "UNSUBSCRIBE", and we will immediately remove you from our mailing list, if you are on it.

 

From: pgsql-general-owner@postgresql.org [mailto:pgsql-general-owner@postgresql.org] On Behalf Of Dan Cooperstock at Software4Nonprofits
Sent: August 1, 2017 12:21 PM
To: pgsql-general@postgresql.org
Subject: [SPAM] [GENERAL] Problem compiling a C function on Windows - not finding _palloc0@4

 

I’m trying to compile a C function into a DLL for use in PostgreSQL, with Visual Studio. I’m linking in postgres.lib, but when the linker runs, I’m getting “unresolved external symbol _palloc0@4 referenced in function _getSoundex@4”. The code is just calling palloc0. I suspect it’s something about the calling convention, but I’ve tried both __stdcall and _cdecl and I get the same error.

 

I’m pre-declaring the function with PGDLLEXPORT to make sure it gets exported.

 

Any thoughts? Thanks.

 

--------------------------------------------------------

Dan Cooperstock
DONATION and ACCOUNTS web site: http://www.Software4Nonprofits.com
Email: info@Software4Nonprofits.com
Phone: 416-423-7722
Mail: 57 Gledhill Ave., Toronto ON M4C 5K7, Canada

If you do not want to receive any further emails from Software4Nonprofits, please reply to this email with the subject line "UNSUBSCRIBE", and we will immediately remove you from our mailing list, if you are on it.

 

pgsql-general by date:

Previous
From: Michael Paquier
Date:
Subject: Re: [GENERAL] standby database crash
Next
From: Merlin Moncure
Date:
Subject: Re: [GENERAL] Shared Constants in PLPGSQL