Shaun McCloud smccloud at geo-comm.com
Thu Aug 9 06:56:36 PDT 2012
I ended up having to find a copy of Visual C++ 2008 Express to compile it, but I got it working.  I did also have to copy src\backend\slony1_funcs.dll to my PostgreSQL lib directory, so that might need to be added to the directions.  I believe the reason my first compile wouldn't work when copied over is because I installed PostgreSQL into a completely different directory and for some reason Slony doesn't see a Windows Symbolic Link (mklink in Vista & above) the same as it does in *NIX.

Shaun McCloud, MCDST | Associate Software Developer
Geo-Comm Inc. | www.geo-comm.com

-----Original Message-----
From: Steve Singer [mailto:ssinger at ca.afilias.info] 
Sent: Wednesday, August 08, 2012 20:47
To: Shaun McCloud
Cc: slony1-general at lists.slony.info
Subject: Re: [Slony1-general] Compiling Slony-I 2.1.1 against PostgreSQL 8.4 on a64 Windows

On 12-08-08 05:32 PM, Shaun McCloud wrote:
> Hello,
>
> I have successfully compiled Slony-I 2.1.1 against PostgreSQL 8.4 on x86 Windows and against PostgreSQL 9.0 x64 on x64 Windows but I am unable to compile it against PostgreSQL 8.4 on x64 Windows.

The only one-click installer for 8.4 (Windows) I see on the EDB website 
is for a x86 (32bit) version of Postgresql.   This should install okay 
on a x64 version of Windows.  I assume this is what you did.

If so you need to make sure that your compiling a 32 bit version of slony (since your linking against a 32 bit version of postgresql).

When I install the Win32 SDK on a x64 version of windows,  under the "Microsoft Platform SDK for Windows 2003" menu it gives me options for both "Windows Server 2003 32 bit build environment" and  "Windows Server
2003 64-bit Build environment"

make sure you select the 32 bit build environment.  I suspect this is your issue.  If not let us know and I'll look further at it.


>
> I'm following the directions at http://slony.info/documentation/2.1/administration.html#BUILDINGWIN32 and use the following commands to set my environment variables.
> set PG_INC=c:\Postgresql\8.4\include
> set PG_LIB=c:\Postgresql\8.4\lib
> set PGSHARE=c:\\Postgresql\\8.4\\share
> set PTHREADS_INC=C:\Slony\pthreads\include
> set PTHREADS_LIB=C:\Slony\pthreads\lib\x86
> set GETTEXT_LIB=C:\Slony\gettext\lib
>
> I have also tried set PTHREADS_LIB=C:\Slony\pthreads\lib\x64 instead of set PTHREADS_LIB=C:\Slony\pthreads\lib\x86 but it doesn't matter.
>
> I end up getting the following errors trying to build slony1_funcs.dll and haven't been able to compile slon or slonik either.
>
> slony1_funcs.obj : error LNK2019: unresolved external symbol Int64GetDatum referenced in function _Slony_I_createEvent
> slony1_funcs.obj : error LNK2019: unresolved external symbol SPI_finish referenced in function _Slony_I_createEvent
> slony1_funcs.obj : error LNK2019: unresolved external symbol DirectFunctionCall1 referenced in function _Slony_I_createEvent
> slony1_funcs.obj : error LNK2019: unresolved external symbol textout referenced in function _Slony_I_createEvent
> slony1_funcs.obj : error LNK2019: unresolved external symbol SPI_getbinval referenced in function _Slony_I_createEvent
> slony1_funcs.obj : error LNK2019: unresolved external symbol __imp_SPI_tuptable referenced in function _Slony_I_createEvent
> slony1_funcs.obj : error LNK2019: unresolved external symbol __imp_SPI_processed referenced in function _Slony_I_createEvent
> slony1_funcs.obj : error LNK2019: unresolved external symbol SPI_execp referenced in function _Slony_I_createEvent
> slony1_funcs.obj : error LNK2019: unresolved external symbol SPI_connect referenced in function _Slony_I_createEvent
> slony1_funcs.obj : error LNK2019: unresolved external symbol elog_finish referenced in function _Slony_I_createEvent
> slony1_funcs.obj : error LNK2019: unresolved external symbol elog_start referenced in function _Slony_I_createEvent
> slony1_funcs.obj : error LNK2019: unresolved external symbol GetActiveSnapshot referenced in function _Slony_I_createEvent
> slony1_funcs.obj : error LNK2019: unresolved external symbol GetTopTransactionId referenced in function _Slony_I_createEvent
> slony1_funcs.obj : error LNK2019: unresolved external symbol MemoryContextAlloc referenced in function _Slony_I_getModuleVersion
> slony1_funcs.obj : error LNK2019: unresolved external symbol __imp_CurrentMemoryContext referenced in function _Slony_I_getModuleVersion
> slony1_funcs.obj : error LNK2019: unresolved external symbol FunctionCall2 referenced in function _Slony_I_logTrigger
> slony1_funcs.obj : error LNK2019: unresolved external symbol lookup_type_cache referenced in function _Slony_I_logTrigger
> slony1_funcs.obj : error LNK2019: unresolved external symbol SPI_gettypeid referenced in function _Slony_I_logTrigger
> slony1_funcs.obj : error LNK2019: unresolved external symbol SPI_getvalue referenced in function _Slony_I_logTrigger
> slony1_funcs.obj : error LNK2019: unresolved external symbol set_config_option referenced in function _Slony_I_logTrigger
> slony1_funcs.obj : error LNK2019: unresolved external symbol GetConfigOptionByName referenced in function _Slony_I_logTrigger
> slony1_funcs.obj : error LNK2019: unresolved external symbol SPI_fname referenced in function _Slony_I_logTrigger
> slony1_funcs.obj : error LNK2019: unresolved external symbol SPI_freetuptable referenced in function _Slony_I_logTrigger
> slony1_funcs.obj : error LNK2019: unresolved external symbol namein referenced in function _Slony_I_logTrigger
> slony1_funcs.obj : error LNK2019: unresolved external symbol __imp_SessionReplicationRole referenced in function _Slony_I_logTrigger
> slony1_funcs.obj : error LNK2019: unresolved external symbol pgkill referenced in function _Slony_I_killBackend
> slony1_funcs.obj : error LNK2019: unresolved external symbol pg_detoast_datum referenced in function _Slony_I_killBackend
> slony1_funcs.obj : error LNK2019: unresolved external symbol superuser referenced in function _Slony_I_killBackend
> slony1_funcs.obj : error LNK2019: unresolved external symbol pg_mblen referenced in function slon_quote_literal
> slony1_funcs.obj : error LNK2019: unresolved external symbol SPI_saveplan referenced in function getClusterStatus
> slony1_funcs.obj : error LNK2019: unresolved external symbol SPI_prepare referenced in function getClusterStatus
> slony1_funcs.obj : error LNK2019: unresolved external symbol pg_sprintf referenced in function getClusterStatus
> slony1_funcs.obj : error LNK2019: unresolved external symbol lappend referenced in function getClusterStatus
> slony1_funcs.obj : error LNK2019: unresolved external symbol makeString referenced in function getClusterStatus
> slony1_funcs.obj : error LNK2019: unresolved external symbol __imp_newNodeMacroHolder referenced in function getClusterStatus
> slony1_funcs.obj : error LNK2019: unresolved external symbol MemoryContextAllocZeroAligned referenced in function getClusterStatus
> slony1_funcs.obj : error LNK2019: unresolved external symbol SPI_exec referenced in function getClusterStatus
> slony1_funcs.obj : error LNK2019: unresolved external symbol pg_snprintf referenced in function getClusterStatus
> slony1_funcs.obj : error LNK2019: unresolved external symbol quote_ident referenced in function getClusterStatus
> slony1_funcs.obj : error LNK2019: unresolved external symbol textin referenced in function getClusterStatus
> slony1_funcs.obj : error LNK2019: unresolved external symbol DirectFunctionCall2 referenced in function getClusterStatus
> slony1_funcs.obj : error LNK2019: unresolved external symbol nameeq referenced in function getClusterStatus
> slony1_funcs.obj : error LNK2019: unresolved external symbol SPI_freeplan referenced in function _Slony_I_resetSession
> slony1_funcs.obj : error LNK2019: unresolved external symbol array_set referenced in function _slon_decode_tgargs
> slony1_funcs.obj : error LNK2019: unresolved external symbol construct_empty_array referenced in function _slon_decode_tgargs
> slony1_funcs.dll : fatal error LNK1120: 45 unresolved externals
> NMAKE : fatal error U1077: '"C:\Program Files (x86)\Microsoft Visual Studio 9.0\VC\Bin\amd64\link.exe"' : return code '0x460'
> Stop.
>
> Do I need to force it to use the x86_64  linker instead of the amd64 one?
>
> I already tried to copy the build I made on the x86 machine over and it won't work.
>
> Shaun McCloud, MCDST | Associate Software Developer
> Geo-Comm Inc. | www.geo-comm.com
> 601 W. Saint Germain St., St. Cloud, MN, 56301
> Office: 320.240.0040 or 888.436.2666 Fax: 320.240.2389
> _______________________________________________
> Slony1-general mailing list
> Slony1-general at lists.slony.info
> http://lists.slony.info/mailman/listinfo/slony1-general
>



More information about the Slony1-general mailing list