Greg Sabino Mullane wrote:
-----BEGIN PGP SIGNED MESSAGE-----
Hash: RIPEMD160
The directions in the README got me a DBD::Pg that could not connect to
a database at all... (the tests should not pass if it does that!)
Yes, those directions are outdated and need to be updated. So feel free
to submit a patch! We have very few people on the list running Windows,
thus it doesn't get as much attention as the *nix side of things.
Hi,
these instructions still work perfect. To be sureI just built DBD::Pg with
strawberry 5.10.4 following Mark Dootsons recipe:
Makefile.PL -
add 'use DBI::DBD;'.
comment out "unlink $output->{MAKEFILE};" at line 247
set required environment:
set PATH=C:\PROGRA~1\PostgreSQL\8.3\bin;%PATH%
set DBI_DSN=dbi:Pg:dbname=testdb
set DBI_USER=username
set DBI_PASS=password
set POSTGRES_HOME=C:/PROGRA~1/PostgreSQL/8.3
set POSTGRES_INCLUDE=C:/PROGRA~1/PostgreSQL/8.3/include
set POSTGRES_LIB=C:/PROGRA~1/PostgreSQL/8.3/lib
perl Makefile.PL
Now here's the ugly bit: edited both EXTRALIBS and LDLOADLIBS in the resulting Makefile to include
C:\PROGRA~1\PostgreSQL\8.3\lib\libpq.lib
then
dmake
dmake test
all works fine.
(See attached file)
I had an error related to File::Temp and one failing test in connect.t which
might be related to my local configuration - I didn't examine further.
Regards, Christoph
C:\Dokumente und Einstellungen\perl5105\Desktop\DBD-Pg-2.13.1>dmake
gcc -c -I"C:/Programme/PostgreSQL/8.3/include" -IC:\strawberry\perl\site\lib\au
to\DBI -s -O2 -DWIN32 -DHAVE_DES_FCRYPT -DPERL_IMPLICIT_CONTEXT -DPERL_IMPLICI
T_SYS -fno-strict-aliasing -DPERL_MSVCRT_READFIX -DPGLIBVERSION=80306 -DPGDEFPOR
T=5432 -s -O2 -DVERSION=\"2.13.1\" -DXS_VERSION=\"2.13.1\" "-IC:\strawberr
y\perl\lib\CORE" Pg.c
In file included from C:/strawberry/perl/lib/CORE/win32thread.h:4,
from C:/strawberry/perl/lib/CORE/perl.h:2748,
from C:/strawberry/perl/site/lib/auto/DBI/DBIXS.h:19,
from Pg.h:57,
from Pg.xs:14:
C:/strawberry/perl/lib/CORE/win32.h:238:1: warning: "isnan" redefined
In file included from Pg.h:13,
from Pg.xs:14:
C:/strawberry/c/bin/../lib/gcc/mingw32/3.4.5/../../../../include/math.h:380:1: w
arning: this is the location of the previous definition
gcc -c -I"C:/Programme/PostgreSQL/8.3/include" -IC:\strawberry\perl\site\lib\au
to\DBI -s -O2 -DWIN32 -DHAVE_DES_FCRYPT -DPERL_IMPLICIT_CONTEXT -DPERL_IMPLICI
T_SYS -fno-strict-aliasing -DPERL_MSVCRT_READFIX -DPGLIBVERSION=80306 -DPGDEFPOR
T=5432 -s -O2 -DVERSION=\"2.13.1\" -DXS_VERSION=\"2.13.1\" "-IC:\strawberr
y\perl\lib\CORE" dbdimp.c
In file included from C:/strawberry/perl/lib/CORE/win32thread.h:4,
from C:/strawberry/perl/lib/CORE/perl.h:2748,
from C:/strawberry/perl/site/lib/auto/DBI/DBIXS.h:19,
from Pg.h:57,
from dbdimp.c:16:
C:/strawberry/perl/lib/CORE/win32.h:238:1: warning: "isnan" redefined
In file included from Pg.h:13,
from dbdimp.c:16:
C:/strawberry/c/bin/../lib/gcc/mingw32/3.4.5/../../../../include/math.h:380:1: w
arning: this is the location of the previous definition
gcc -c -I"C:/Programme/PostgreSQL/8.3/include" -IC:\strawberry\perl\site\lib\au
to\DBI -s -O2 -DWIN32 -DHAVE_DES_FCRYPT -DPERL_IMPLICIT_CONTEXT -DPERL_IMPLICI
T_SYS -fno-strict-aliasing -DPERL_MSVCRT_READFIX -DPGLIBVERSION=80306 -DPGDEFPOR
T=5432 -s -O2 -DVERSION=\"2.13.1\" -DXS_VERSION=\"2.13.1\" "-IC:\strawberr
y\perl\lib\CORE" quote.c
In file included from C:/strawberry/perl/lib/CORE/win32thread.h:4,
from C:/strawberry/perl/lib/CORE/perl.h:2748,
from C:/strawberry/perl/site/lib/auto/DBI/DBIXS.h:19,
from Pg.h:57,
from quote.c:12:
C:/strawberry/perl/lib/CORE/win32.h:238:1: warning: "isnan" redefined
In file included from Pg.h:13,
from quote.c:12:
C:/strawberry/c/bin/../lib/gcc/mingw32/3.4.5/../../../../include/math.h:380:1: w
arning: this is the location of the previous definition
gcc -c -I"C:/Programme/PostgreSQL/8.3/include" -IC:\strawberry\perl\site\lib\au
to\DBI -s -O2 -DWIN32 -DHAVE_DES_FCRYPT -DPERL_IMPLICIT_CONTEXT -DPERL_IMPLICI
T_SYS -fno-strict-aliasing -DPERL_MSVCRT_READFIX -DPGLIBVERSION=80306 -DPGDEFPOR
T=5432 -s -O2 -DVERSION=\"2.13.1\" -DXS_VERSION=\"2.13.1\" "-IC:\strawberr
y\perl\lib\CORE" types.c
In file included from C:/strawberry/perl/lib/CORE/win32thread.h:4,
from C:/strawberry/perl/lib/CORE/perl.h:2748,
from C:/strawberry/perl/site/lib/auto/DBI/DBIXS.h:19,
from Pg.h:57,
from types.c:17:
C:/strawberry/perl/lib/CORE/win32.h:238:1: warning: "isnan" redefined
In file included from Pg.h:13,
from types.c:17:
C:/strawberry/c/bin/../lib/gcc/mingw32/3.4.5/../../../../include/math.h:380:1: w
arning: this is the location of the previous definition
Running Mkbootstrap for DBD::Pg ()
C:\strawberry\perl\bin\perl.exe -MExtUtils::Command -e chmod 644 Pg.bs
dlltool --def Pg.def --output-exp dll.exp
g++ -o blib\arch\auto\DBD\Pg\Pg.dll -Wl,--base-file -Wl,dll.base -mdll -s -L"C:\
strawberry\perl\lib\CORE" -L"C:\strawberry\c\lib" Pg.o dbdimp.o quote.o types.o
-Wl,--image-base,0x3c0b0000 C:\strawberry\perl\lib\CORE\libperl510.a C:\strawbe
rry\c\lib\libm.a C:\strawberry\c\lib\libsecur32.a C:\strawberry\c\lib\libmsvcrt.
a C:\strawberry\c\lib\libmoldname.a C:\strawberry\c\lib\libkernel32.a C:\strawbe
rry\c\lib\libuser32.a C:\strawberry\c\lib\libgdi32.a C:\strawberry\c\lib\libwins
pool.a C:\strawberry\c\lib\libcomdlg32.a C:\strawberry\c\lib\libadvapi32.a C:\st
rawberry\c\lib\libshell32.a C:\strawberry\c\lib\libole32.a C:\strawberry\c\lib\l
iboleaut32.a C:\strawberry\c\lib\libnetapi32.a C:\strawberry\c\lib\libuuid.a C:\
strawberry\c\lib\libws2_32.a C:\strawberry\c\lib\libmpr.a C:\strawberry\c\lib\li
bwinmm.a C:\strawberry\c\lib\libversion.a C:\strawberry\c\lib\libodbc32.a C:\str
awberry\c\lib\libodbccp32.a C:\Programme\PostgreSQL\8.3\lib\libpq.lib dll.exp
dlltool --def Pg.def --base-file dll.base --output-exp dll.exp
g++ -o blib\arch\auto\DBD\Pg\Pg.dll -mdll -s -L"C:\strawberry\perl\lib\CORE" -L"
C:\strawberry\c\lib" Pg.o dbdimp.o quote.o types.o -Wl,--image-base,0x3c0b0000
C:\strawberry\perl\lib\CORE\libperl510.a C:\strawberry\c\lib\libm.a C:\strawberr
y\c\lib\libsecur32.a C:\strawberry\c\lib\libmsvcrt.a C:\strawberry\c\lib\libmold
name.a C:\strawberry\c\lib\libkernel32.a C:\strawberry\c\lib\libuser32.a C:\stra
wberry\c\lib\libgdi32.a C:\strawberry\c\lib\libwinspool.a C:\strawberry\c\lib\li
bcomdlg32.a C:\strawberry\c\lib\libadvapi32.a C:\strawberry\c\lib\libshell32.a C
:\strawberry\c\lib\libole32.a C:\strawberry\c\lib\liboleaut32.a C:\strawberry\c\
lib\libnetapi32.a C:\strawberry\c\lib\libuuid.a C:\strawberry\c\lib\libws2_32.a
C:\strawberry\c\lib\libmpr.a C:\strawberry\c\lib\libwinmm.a C:\strawberry\c\lib\
libversion.a C:\strawberry\c\lib\libodbc32.a C:\strawberry\c\lib\libodbccp32.a C
:\Programme\PostgreSQL\8.3\lib\libpq.lib dll.exp
C:\strawberry\perl\bin\perl.exe -MExtUtils::Command -e chmod 755 blib\arch\auto\
DBD\Pg\Pg.dll
C:\strawberry\perl\bin\perl.exe -MExtUtils::Command -e cp Pg.bs blib\arch\auto\D
BD\Pg\Pg.bs
C:\strawberry\perl\bin\perl.exe -MExtUtils::Command -e chmod 644 blib\arch\auto\
DBD\Pg\Pg.bs
C:\Dokumente und Einstellungen\perl5105\Desktop\DBD-Pg-2.13.1>dmake test
C:\strawberry\perl\bin\perl.exe "-MExtUtils::Command::MM" "-e" "test_harness(0,
'blib\lib', 'blib\arch')" t/*.t
t/00-signature......skipped: Set the environment variable TEST_SIGNATURE to enab
le this test
t/00basic...........ok
t/01connect.........4/13
# Failed test 'Connect with invalid option fails'
# at t/01connect.t line 76.
# ''
# doesn't match '(?-xism:DBI connect.+failed:)'
t/01connect.........12/13 #
# DBI Version 1.607
# DBD::Pg Version 2.13.1
# Perl Version 5.10.0
# OS MSWin32
# PostgreSQL (compiled) 80306
# PostgreSQL (target) 80306
# PostgreSQL (reported) PostgreSQL 8.3.6, compiled by Visual C++ build 140
0
# Default port 5432
# DBI_DSN dbi:Pg:db="testdb"
# DBI_USER postgres
# Test schema dbd_pg_testschema
# array_nulls on
# backslash_quote safe_encoding
# client_encoding UTF8
# server_encoding UTF8
# standard_conforming_strings off
# Looks like you failed 1 test of 13.
t/01connect......... Dubious, test returned 1 (wstat 256, 0x100)
Failed 1/13 subtests
t/01constants.......ok
t/02attribs.........ok
t/03dbmethod........ok
t/03smethod.........ok
t/04misc............43/54 Error removing dbdpg_test_Pum0ehtst at C:/STRAWB~3/per
l/lib/File/Temp.pm line 890.
t/04misc............ok
t/06bytea...........ok
t/07copy............ok
t/08async...........ok
t/09arrays..........ok
t/12placeholders....ok
t/20savepoints......ok
t/99_perlcritic.....skipped: Set the environment variable TEST_CRITIC to enable
this test
t/99_pod............skipped: Set the environment variable TEST_AUTHOR to enable
this test
t/99_spellcheck.....skipped: Set the environment variable TEST_SPELL to enable t
his test
t/99_yaml...........ok
t/99cleanup.........1/1 Removing test database directory
t/99cleanup.........ok
Test Summary Report
-------------------
t/01connect (Wstat: 256 Tests: 13 Failed: 1)
Failed test: 9
Non-zero exit status: 1
Files=19, Tests=1500, 60 wallclock secs ( 1.00 usr + 0.09 sys = 1.09 CPU)
Result: FAIL
Failed 1/19 test programs. 1/1500 subtests failed.
dmake: Error code 255, while making 'test_dynamic'
C:\Dokumente und Einstellungen\perl5105\Desktop\DBD-Pg-2.13.1>