Confusion of Win32::ODBC under CygWin. Please help...

Discussion in 'Perl Misc' started by MartinM, Aug 22, 2004.

  1. MartinM

    MartinM Guest

    Hi,

    I use Perl under Cygwin. I need to use Win32::ODBC. It is located
    in

    c:\cygwin\lib\perl5\site_perl\5.8.2\cygwin-thread-multi-64int\Win32\ODBC.pm

    but this path is not in @INC. There are just links 5.8.5 not 5.8.2
    in the @INC and (to my surprise), the 5.8.5/cygwin-thread-multi-64int
    is completely empty.

    The @INC includes:
    /usr/lib/perl5/5.8.5/cygwin-thread-multi-64int
    /usr/lib/perl5/5.8.5
    /usr/lib/perl5/site_perl/5.8.5/cygwin-thread-multi-64int
    /usr/lib/perl5/site_perl/5.8.5
    /usr/lib/perl5/site_perl
    /usr/lib/perl5/vendor_perl/5.8.5/cygwin-thread-multi-64int
    /usr/lib/perl5/vendor_perl/5.8.5
    /usr/lib/perl5/vendor_perl

    So the execution of code with use Win32::ODBC; ends up with
    Can't locate Win32/ODBC...

    If I copy content of 5.8.2/ into 5.8.5 it results with error

    Can't load the
    /usr/lib/perl5/site_perl/5.8.5/cygwin-thread-multi-64int/auto/Win32/ODBC/ODBC.dll
    for module Win32/ODBC: dlopen: Win32 error 126 at
    /usr/lib/perl5/site_perl/5.8.5/cygwin-thread-multi-64int/Dynaloader.pm
    line 230



    Please, can you send a piece of advice to me?

    Martin
     
    MartinM, Aug 22, 2004
    #1
    1. Advertising

  2. (MartinM) wrote in
    news::

    > Hi,
    >
    > I use Perl under Cygwin. I need to use Win32::ODBC. It is located
    > in
    >
    > c:\cygwin\lib\perl5\site_perl\5.8.2\cygwin-thread-multi-64int\Win32\ODB
    > C.pm
    >
    > but this path is not in @INC. There are just links 5.8.5 not 5.8.2
    > in the @INC and (to my surprise), the 5.8.5/cygwin-thread-multi-64int
    > is completely empty.
    >

    ....
    >
    > So the execution of code with use Win32::ODBC; ends up with
    > Can't locate Win32/ODBC...
    >
    > If I copy content of 5.8.2/ into 5.8.5 it results with error
    >
    > Can't load the
    > /usr/lib/perl5/site_perl/5.8.5/cygwin-thread-multi-64int/auto/Win32/ODB
    > C/ODBC.dll for module Win32/ODBC: dlopen: Win32 error 126 at
    > /usr/lib/perl5/site_perl/5.8.5/cygwin-thread-multi-64int/Dynaloader.pm
    > line 230
    >
    > Please, can you send a piece of advice to me?



    What is the output of perl -v?

    It looks like your Win32::ODBC was compiled for perl 5.8.2 whereas you
    have perl 5.8.5. You need probably need to reinstall Win32::ODBC.

    --
    A. Sinan Unur
    d
    (remove '.invalid' and reverse each component for email address)
     
    A. Sinan Unur, Aug 22, 2004
    #2
    1. Advertising

  3. MartinM

    Chris Guest

    MartinM wrote:
    > Hi,
    >
    > I use Perl under Cygwin. I need to use Win32::ODBC. It is located
    > in
    >
    > c:\cygwin\lib\perl5\site_perl\5.8.2\cygwin-thread-multi-64int\Win32\ODBC.pm
    >
    > but this path is not in @INC. There are just links 5.8.5 not 5.8.2
    > in the @INC and (to my surprise), the 5.8.5/cygwin-thread-multi-64int
    > is completely empty.
    >
    > The @INC includes:
    > /usr/lib/perl5/5.8.5/cygwin-thread-multi-64int
    > /usr/lib/perl5/5.8.5
    > /usr/lib/perl5/site_perl/5.8.5/cygwin-thread-multi-64int
    > /usr/lib/perl5/site_perl/5.8.5
    > /usr/lib/perl5/site_perl
    > /usr/lib/perl5/vendor_perl/5.8.5/cygwin-thread-multi-64int
    > /usr/lib/perl5/vendor_perl/5.8.5
    > /usr/lib/perl5/vendor_perl
    >
    > So the execution of code with use Win32::ODBC; ends up with
    > Can't locate Win32/ODBC...
    >
    > If I copy content of 5.8.2/ into 5.8.5 it results with error
    >
    > Can't load the
    > /usr/lib/perl5/site_perl/5.8.5/cygwin-thread-multi-64int/auto/Win32/ODBC/ODBC.dll
    > for module Win32/ODBC: dlopen: Win32 error 126 at
    > /usr/lib/perl5/site_perl/5.8.5/cygwin-thread-multi-64int/Dynaloader.pm
    > line 230
    >
    >
    >
    > Please, can you send a piece of advice to me?


    My advice is to not try to mix and marry Cygwin Perl and ActiveState
    Perl (assuming that is where you are getting Win32::ODBC from?). Not
    only are you going to have the problems you speak of above, but you are
    going to have other pathing issues as well (Cygwin/Unix style paths vs.
    Windows paths with drive names). This has been my experience anyway.

    My personal solution to this, since both Perls are actually native Win32
    images, is to place a symlink in /usr/bin under Cygwin that points to
    ActiveState Perl and use THAT in my Perl scripts under Cygwin that
    require specific Win32 capabilities:

    $ ln -sn /cygdrive/c/perl/bin/perl.exe /usr/bin/winperl.exe
    $ winperl -v
    ....blah, blah, blah version information from AS Perl...
    $ perl -v
    ....blah, blah, blah version information from Cygwin Perl...

    Then begin all Cygwin Perl scripts that require Win32 modules with:

    #!/usr/bin/winperl -w

    The caveat with this is that AS Perl, even under Cygwin, still wants
    Windows style pathings (eg. with drive letters, "\" etc.) whereas Cygwin
    Perl expects Unix style pathings (eg. "/"). Not to mention your
    she-bang is a little non-conventional. But the plus to the she-bang is
    since AS Perl doesn't use the she-bang line (except to pick up options
    like -w), then scripts written using 'winperl' work well at both the
    Cygwin shell prompt as well as a regular Win32 Command Prompt window.

    The symlink hack will also solve your version discrepancies as well
    between the two versions. (I, for instance, am running AS Perl v5.8.3
    and Cygwin Perl v5.8.2). I've found this to work best. YMMV.

    HTH,
    -ceo
     
    Chris, Aug 23, 2004
    #3
  4. Chris <> wrote in
    news:TbrWc.5880$:

    > MartinM wrote:
    >> Hi,
    >>
    >> I use Perl under Cygwin. I need to use Win32::ODBC. It is located
    >> in
    >>
    >> c:\cygwin\lib\perl5\site_perl\5.8.2\cygwin-thread-multi-64int\Win32\OD
    >> BC.pm
    >>
    >> but this path is not in @INC. There are just links 5.8.5 not 5.8.2
    >> in the @INC and (to my surprise), the 5.8.5/cygwin-thread-multi-64int
    >> is completely empty.
    >>
    >> The @INC includes:
    >> /usr/lib/perl5/5.8.5/cygwin-thread-multi-64int
    >> /usr/lib/perl5/5.8.5
    >> /usr/lib/perl5/site_perl/5.8.5/cygwin-thread-multi-64int
    >> /usr/lib/perl5/site_perl/5.8.5
    >> /usr/lib/perl5/site_perl
    >> /usr/lib/perl5/vendor_perl/5.8.5/cygwin-thread-multi-64int
    >> /usr/lib/perl5/vendor_perl/5.8.5
    >> /usr/lib/perl5/vendor_perl
    >>
    >> So the execution of code with use Win32::ODBC; ends up with
    >> Can't locate Win32/ODBC...
    >>
    >> If I copy content of 5.8.2/ into 5.8.5 it results with error
    >>
    >> Can't load the
    >> /usr/lib/perl5/site_perl/5.8.5/cygwin-thread-multi-64int/auto/Win32/OD
    >> BC/ODBC.dll for module Win32/ODBC: dlopen: Win32 error 126 at
    >> /usr/lib/perl5/site_perl/5.8.5/cygwin-thread-multi-64int/Dynaloader.pm
    >> line 230
    >>
    >> Please, can you send a piece of advice to me?

    >
    > My advice is to not try to mix and marry Cygwin Perl and ActiveState
    > Perl


    That is not what he is doing at all.

    > (assuming that is where you are getting Win32::ODBC from?).


    No. He is getting that from the lib directory of a previous version of perl
    (from the Cygwin distribution).

    You seem to be unaware of the fact that the cygwin setup program includes
    the Win32 modules as an extra download that can be selected separately.

    > My personal solution to this, since both Perls are actually native
    > Win32 images, is to place a symlink in /usr/bin under Cygwin that
    > points to ActiveState Perl and use THAT in my Perl scripts under
    > Cygwin that require specific Win32 capabilities:


    This is kinda nuts. You say not to mix various perls and then you go ahead
    and do that.

    The solution to the OP's problem is to install (using the Cygwin setup
    program) the the Cygwin versions of the Win32 modules.

    Sinan.
     
    A. Sinan Unur, Aug 23, 2004
    #4
  5. MartinM

    ChrisO Guest

    A. Sinan Unur wrote:
    > Chris <> wrote in
    > news:TbrWc.5880$:
    >
    >
    >>MartinM wrote:
    >>
    >>>Hi,
    >>>
    >>>I use Perl under Cygwin. I need to use Win32::ODBC. It is located
    >>>in
    >>>
    >>>c:\cygwin\lib\perl5\site_perl\5.8.2\cygwin-thread-multi-64int\Win32\OD
    >>>BC.pm
    >>>
    >>>but this path is not in @INC. There are just links 5.8.5 not 5.8.2
    >>>in the @INC and (to my surprise), the 5.8.5/cygwin-thread-multi-64int
    >>>is completely empty.
    >>>
    >>>The @INC includes:
    >>> /usr/lib/perl5/5.8.5/cygwin-thread-multi-64int
    >>> /usr/lib/perl5/5.8.5
    >>> /usr/lib/perl5/site_perl/5.8.5/cygwin-thread-multi-64int
    >>> /usr/lib/perl5/site_perl/5.8.5
    >>> /usr/lib/perl5/site_perl
    >>> /usr/lib/perl5/vendor_perl/5.8.5/cygwin-thread-multi-64int
    >>> /usr/lib/perl5/vendor_perl/5.8.5
    >>> /usr/lib/perl5/vendor_perl
    >>>
    >>>So the execution of code with use Win32::ODBC; ends up with
    >>>Can't locate Win32/ODBC...
    >>>
    >>>If I copy content of 5.8.2/ into 5.8.5 it results with error
    >>>
    >>>Can't load the
    >>>/usr/lib/perl5/site_perl/5.8.5/cygwin-thread-multi-64int/auto/Win32/OD
    >>>BC/ODBC.dll for module Win32/ODBC: dlopen: Win32 error 126 at
    >>>/usr/lib/perl5/site_perl/5.8.5/cygwin-thread-multi-64int/Dynaloader.pm
    >>>line 230
    >>>
    >>>Please, can you send a piece of advice to me?

    >>
    >>My advice is to not try to mix and marry Cygwin Perl and ActiveState
    >>Perl

    >
    >
    > That is not what he is doing at all.
    >
    >
    >>(assuming that is where you are getting Win32::ODBC from?).

    >
    >
    > No. He is getting that from the lib directory of a previous version of perl
    > (from the Cygwin distribution).
    >
    > You seem to be unaware of the fact that the cygwin setup program includes
    > the Win32 modules as an extra download that can be selected separately.
    >


    Indeed I was not aware and that certainly clouded my response. I would
    be quite surprised however to see that the Win32 modules under Cygwin
    compare well to the support in AS however. I'll have to check it out.

    >
    >>My personal solution to this, since both Perls are actually native
    >>Win32 images, is to place a symlink in /usr/bin under Cygwin that
    >>points to ActiveState Perl and use THAT in my Perl scripts under
    >>Cygwin that require specific Win32 capabilities:

    >
    >
    > This is kinda nuts. You say not to mix various perls and then you go ahead
    > and do that.
    >


    This is not mixing them. They are *quite* separate using this method
    (which you call "nuts".) In fact, the separation is the point. I think
    you would find this a sensible solution if you tried it. It works
    terrifically well.

    > The solution to the OP's problem is to install (using the Cygwin setup
    > program) the the Cygwin versions of the Win32 modules.
    >


    My last point remains moot in light of your revealing the presence of
    the Win32 mods under Cygwin. I'll have to check these out before
    commenting further.

    -ceo
     
    ChrisO, Aug 24, 2004
    #5
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. usenet
    Replies:
    2
    Views:
    3,527
    usenet
    May 22, 2005
  2. Replies:
    0
    Views:
    520
  3. Replies:
    0
    Views:
    461
  4. WELCOME to

    , Sep 3, 2003, in forum: Python
    Replies:
    1
    Views:
    538
    Robin Becker
    Sep 5, 2003
  5. Jim Roberts
    Replies:
    7
    Views:
    258
    Bart Lateur
    Jan 4, 2006
Loading...

Share This Page