Beefy Boxes and Bandwidth Generously Provided by pair Networks
"be consistent"
 
PerlMonks  

DBD::Pg on Windows with ActivePerl

by tswall (Monk)
on Oct 20, 2009 at 14:00 UTC ( [id://802237]=perlquestion: print w/replies, xml ) Need Help??

tswall has asked for the wisdom of the Perl Monks concerning the following question:

I have been trying for some time now to get DBD::Pg to install via PPM on version 5.10 of ActivePerl. I'm hoping some esteemed Monk will be able to offer some insights.

I have installed the following under Windows Vista:

Postgresql v8.4 (latest windows binary)
ActivePerl 5.10.1 (again, latest windows binary)
DBD::Pg via PgFoundry

When I try to run a simple script with a call to DBI->connect() I get the following:

Runtime Error! (in a Windows alert dialog) Program: C:\Perl\bin\perl.exe R6034 An application has made an attempt to load the C runtime library incor +rectly. Please contact the application's support team for more information
In the Command prompt window there is a different error message:

install_driver(Pg) failed: Can't load 'C:\Perl\site\lib\auto\DBD\Pg\Pg +.dll' for module DBD::Pg ...
I have gone through this node in great detail, as well as many other posts in various forums (PgFoundry, ActiveSite, etc), and can't get anywhere. I gather that the problem is some incompatability between the MSVC runtime libraries that Perl.exe expects and what it finds, as there are a number of posts about sticking MSCVR80.dll or perl.exe.manifest files in the perl/bin directory to make the interpreter happy. I have tried many iterations of this, and I am convinced that I have compatible versions of MSVCR80.dll and a manifest describing it that Perl.exe can find, but I still get this same set of errors. Any insights would be greatly appreciated!

Sincerely,

Scott W.

Replies are listed 'Best First'.
Re: DBD::Pg on Windows with ActivePerl
by CountZero (Bishop) on Oct 20, 2009 at 17:32 UTC
    Did you try installing DBD::Pg with PPM from another than the Activestate repo? The Trouchelle repository has version 2.10 for Perl 5.10 and version 2.14.1 for Perl 5.8.

    CountZero

    A program should be light and agile, its subroutines connected like a string of pearls. The spirit and intent of the program should be retained throughout. There should be neither too little or too much, neither needless loops nor useless variables, neither lack of structure nor overwhelming rigidity." - The Tao of Programming, 4.1 - Geoffrey James

      Thanks CountZero,

      I consider this progres...I reinstalled DBD::Pg from the Trouchelle repository as suggested. I now get a different Windows Error Dialog that specifically mentions that it can't find libintl-8.dll:

      perl.exe = Unable to Locate Component This application has failed to start because libintl-8.dll was not fou +nd. Re-installing the application may fix this problem.
      Any ideas? I snooped around other message boards and couldn't figure out why this was bein DynaLoader'ed.
        It looks as if you need libintl-8.dll and the repository provides libintl3.dll which perhaps seems to be an older version. Maybe your versions of Postgresql and the DBD drivers and the DLLs are out of sync? A desperate measure would be to rename libintl3.dll to libintl-8.dll and hope / pray that the API did not change ...

        If that doesn't work you will have to hunt the Web for a version of libintl-8.dll for your OS.

        CountZero

        A program should be light and agile, its subroutines connected like a string of pearls. The spirit and intent of the program should be retained throughout. There should be neither too little or too much, neither needless loops nor useless variables, neither lack of structure nor overwhelming rigidity." - The Tao of Programming, 4.1 - Geoffrey James

        Any ideas?

        You did not install PostgreSQL correctly (or just did not setup path).

Re: DBD::Pg on Windows with ActivePerl
by runrig (Abbot) on Oct 20, 2009 at 19:11 UTC
    If all else fails, you can try the ODBC driver and DBD::ODBC.
Re: DBD::Pg on Windows with ActivePerl
by BrowserUk (Patriarch) on Oct 21, 2009 at 02:00 UTC

    Have you by any chance installed a 64-bit Perl and a 32-bit binary of DBD::Pg?


    Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
    "Science is about questioning the status quo. Questioning authority".
    In the absence of evidence, opinion is indistinguishable from prejudice.
Re: DBD::Pg on Windows with ActivePerl
by tswall (Monk) on Oct 21, 2009 at 13:15 UTC
    Well, I clearly am a Windows Novice. As it turns out I was trying to set all of the environment variables that Postgresql and DBD::Pg docs kept mentioning to allow for linking to postgresql libraries (namely, POSTGRES_LIB, POSTGRES_INCLUDE and POSTGRES_HOME). As it turns out all DBD::Pg wanted was to have the postgresql bin dir in the PATH. The POSTGRES_ env stuff was totally irrelevant. I assume all DBD::Pg wanted was access to the pg_config.exe utility. Doesn't make sense to me that setting the other environment stuff still left it unable to find libpq.dll and such.

    On another note I did try to install Strawberry perl and install DBD::Pg through CPAN. This resulted in again not being able to locate libpq.dll and such...despite putting it in the PATH, resetting all the POSTGRES environment stuff, etc. I haven't totally given up on this, but I'll save the rest of the troubleshooting for another day, as at least I have my basic DBD::Pg scripts working on a windows platform with ActivePerl.

    Thanks to all for the help!

      I had the same problem. After reading the suggestions here I set PostgreSQL9.3/bin into PATH and that was it. It worked. Thanks
Re: DBD::Pg on Windows with ActivePerl
by Anonymous Monk on Oct 20, 2009 at 16:17 UTC
    Did you check for error messages in event viewer? Did you check each dll with dependencywalker?
      These are great suggestions. Clearly I am a fish out of water in a Windows world...although I am trying my best to remain enthusiastic and improve upon my shortcomings.

      I looked in Event Viewer (once a well-worded Google search told me what Event Viewer was), and there is nothing logged when this error comes up.

      I downloaded and ran Dependency Walker (another Google search) and put the in-question modules through their paces. The only thing that comes up RED are two DLLs in c:\Windows\System32...namely SHLWAPI.DLL and IEFRAME.DLL...two DLLs that, before today I never knew existed. And they DO exist in that system32 folder. The parent DLL that tries to call several functions in IEFRAME.DLL is SHDOCVW.DLL (which exists). I can't for the life of me figure out who/what is trying to call something in SHLWAPI.DLL.

      I do appreciate the input and the crash course in Windows/MSVC troubleshooting.

      SW

        One other point I just noticed in the Dependency Walker traverse of Pg.dll. I would assume that this library has to link to libpq.dll or some other postgres library, especially as the Pg.dll isn't that large of a file (almost as small as libpq.dll in fact). But yet Dependency Walker doesn't seem to think that Pg.dll depends on any Postgresql libraries. This confuses me. I don't entirely understand how ActivePerl and PPM deal with dependencies, but I would have thought that a traverse of Pg.dll's dependencies would have turned up something in Postgresql's libraries.
      Think it's a dynamic load issue (I get a similar error). Dependency walker doesn't help there. :(
Re: DBD::Pg on Windows with ActivePerl
by Anonymous Monk on Oct 20, 2009 at 21:49 UTC
    If you are struggling with active state perl have you had a try of Strawberry Perl. I seem to have had a lot more success installing modules with strawberry than active state. http://strawberryperl.com/
      Hi. I use strawberryperl, and I have trouble installing this CPAN package. It does not come right out of the box. The package has a readmefile for windowsusers: http://cpansearch.perl.org/src/TURNSTEP/DBD-Pg-2.15.1/README.win32

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: perlquestion [id://802237]
Approved by moritz
Front-paged by biohisham
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others taking refuge in the Monastery: (5)
As of 2024-04-19 07:12 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found