public inbox for cygwin@cygwin.com
 help / color / mirror / Atom feed
* building Perl module DBD-ODBC-4.3 under 64-bit cygwin
@ 2013-08-01 12:57 Simon Barnes
  2013-08-01 14:02 ` Corinna Vinschen
  2013-08-01 18:26 ` Yaakov (Cygwin/X)
  0 siblings, 2 replies; 5+ messages in thread
From: Simon Barnes @ 2013-08-01 12:57 UTC (permalink / raw)
  To: cygwin

I'm having difficulty with this and would appreciate any suggestions.   It does build under 32-bit cygwin.

Thanks
Simon

cygwin> perl Makefile.PL

**********
        Remember to actually *READ* the README file!
        And re-read it if you have any problems.

**********

OSNAME: cygwin
LANG:
ODBCHOME: /usr
LD_LIBRARY_PATH:
DBROOT:
WINDIR: C:\Windows
II_SYSTEM:
Perl: 5.014004
ExtUtils::MakeMaker: 6.57_05
Command line options:
  u! = undef
  w! = undef
  e! = undef
  g! = 0
  x! = undef
  o=s =

You are using a Perl configured with threading enabled.
Please read the warnings in DBI about this.

You should also be aware that on non-Windows platforms ODBC drivers come
in two forms, thread-safe and non-thread-safe drivers and you may need
to make sure you are using the right one.

Press return to continue...
Using ODBCHOME /usr
  Looking for iODBC libs in /usr/lib
    Found iODBC libs /usr/lib/libiodbc.dll.a,/usr/lib/libiodbcinst.dll.a in /usr/lib

This looks like a iodbc type of driver manager.
Warning: LD_LIBRARY_PATH doesn't include /usr/lib

Checking if your kit is complete...
Looks good
Using DBI 1.623 (for perl 5.014004 on cygwin-thread-multi) installed in /usr/lib/perl5/vendor_perl/5.14/x86_64-cygwin-threads/auto/DBI/
Using DBI 1.623 (for perl 5.014004 on cygwin-thread-multi) installed in /usr/lib/perl5/vendor_perl/5.14/x86_64-cygwin-threads/auto/DBI/
Writing Makefile for DBD::ODBC
Writing MYMETA.yml
Warning: not all required environment variables are set.

Warning: Will not be able to run tests as you have not defined
all of DBI_DSN, DBI_USER and DBI_PASS environment variables.
cygwin> make
cp Changes blib/lib/DBD/ODBC/Changes.pm
cp FAQ blib/lib/DBD/ODBC/FAQ.pm
cp TO_DO blib/lib/DBD/ODBC/TO_DO.pm
cp ODBC.pm blib/lib/DBD/ODBC.pm
gcc -c -DWITH_UNICODE -I/usr/include  -I. -I/usr/include/w32api -I/usr/lib/perl5/vendor_perl/5.14/x86_64-cygwin-threads/auto/DBI  -DPERL_USE_SAFE_PUTENV -U__STRICT_ANSI__ -fno-strict-aliasing -pipe -fstack-protector -DUSEIMPORTLIB -O3    -DVERSION=\"1.43\"  -DXS_VERSION=\"1.43\"  "-I/usr/lib/perl5/5.14/x86_64-cygwin-threads/CORE"  -DWITH_UNICODE -I/usr/include ConvertUTF.c
/usr/bin/perl.exe -p -e "s/~DRIVER~/ODBC/g" /usr/lib/perl5/vendor_perl/5.14/x86_64-cygwin-threads/auto/DBI/Driver.xst > ODBC.xsi
/usr/bin/perl.exe /usr/lib/perl5/5.14/ExtUtils/xsubpp  -typemap /usr/lib/perl5/5.14/ExtUtils/typemap  ODBC.xs > ODBC.xsc && mv ODBC.xsc ODBC.c
Warning: duplicate function definition 'data_sources' detected in ODBC.xs, line 482
gcc -c -DWITH_UNICODE -I/usr/include  -I. -I/usr/include/w32api -I/usr/lib/perl5/vendor_perl/5.14/x86_64-cygwin-threads/auto/DBI  -DPERL_USE_SAFE_PUTENV -U__STRICT_ANSI__ -fno-strict-aliasing -pipe -fstack-protector -DUSEIMPORTLIB -O3    -DVERSION=\"1.43\"  -DXS_VERSION=\"1.43\"  "-I/usr/lib/perl5/5.14/x86_64-cygwin-threads/CORE"  -DWITH_UNICODE -I/usr/include ODBC.c
In file included from /usr/local/include/sql.h:19:0,
                 from dbdodbc.h:7,
                 from ODBC.h:8,
                 from ODBC.xs:1:
/usr/local/include/sqltypes.h:261:33: error: conflicting types for 'ULONG'
 typedef unsigned long           ULONG;
                                 ^
In file included from /usr/include/w32api/windows.h:69:0,
                 from dbdodbc.h:6,
                 from ODBC.h:8,
                 from ODBC.xs:1:
/usr/include/w32api/windef.h:25:27: note: previous declaration of 'ULONG' was here
 typedef unsigned __LONG32 ULONG;
                           ^
Makefile:390: recipe for target `ODBC.o' failed
make: *** [ODBC.o] Error 1

cygwin> uname -a
CYGWIN_NT-6.1 SLB-70DFXN1 1.7.22(0.268/5/3) 2013-07-22 17:06 x86_64 Cygwin

--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: building Perl module DBD-ODBC-4.3 under 64-bit cygwin
  2013-08-01 12:57 building Perl module DBD-ODBC-4.3 under 64-bit cygwin Simon Barnes
@ 2013-08-01 14:02 ` Corinna Vinschen
  2013-08-01 15:16   ` Corinna Vinschen
  2013-08-01 18:26 ` Yaakov (Cygwin/X)
  1 sibling, 1 reply; 5+ messages in thread
From: Corinna Vinschen @ 2013-08-01 14:02 UTC (permalink / raw)
  To: cygwin

On Aug  1 12:57, Simon Barnes wrote:
> I'm having difficulty with this and would appreciate any suggestions.   It does build under 32-bit cygwin.

That's a good place to point to my extended "how to port to 64 bit" FAQ,
starting here:

  http://cygwin.com/faq/faq.html#faq.programming.64bitporting

Please read this first.

Basically, what you see here...

> /usr/local/include/sqltypes.h:261:33: error: conflicting types for 'ULONG'
>  typedef unsigned long           ULONG;
>                                  ^
> In file included from /usr/include/w32api/windows.h:69:0,
>                  from dbdodbc.h:6,
>                  from ODBC.h:8,
>                  from ODBC.xs:1:
> /usr/include/w32api/windef.h:25:27: note: previous declaration of 'ULONG' was here
>  typedef unsigned __LONG32 ULONG;
>                            ^
> Makefile:390: recipe for target `ODBC.o' failed

...is a typical type conflict.  ULONG is a Windows type defined as
unsigned long in the Win32 API.  The Win32 data model is LLP64, so
unsigned long is 4 bytes.  However, Cygwin is LP64, so unsigned long is
8 bytes.  Therefore the `typedef unsigned long ULONG;' is wrong for 64
bit.  Either drop the definition entirely, or redefine it matching the
data model:

  #ifdef __LP64__
  typedef unsigned int ULONG;
  #else
  typedef unsigned long ULONG;
  #endif

HTH,
Corinna

-- 
Corinna Vinschen                  Please, send mails regarding Cygwin to
Cygwin Maintainer                 cygwin AT cygwin DOT com
Red Hat

--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: building Perl module DBD-ODBC-4.3 under 64-bit cygwin
  2013-08-01 14:02 ` Corinna Vinschen
@ 2013-08-01 15:16   ` Corinna Vinschen
  0 siblings, 0 replies; 5+ messages in thread
From: Corinna Vinschen @ 2013-08-01 15:16 UTC (permalink / raw)
  To: cygwin

On Aug  1 16:02, Corinna Vinschen wrote:
> On Aug  1 12:57, Simon Barnes wrote:
> > I'm having difficulty with this and would appreciate any suggestions.   It does build under 32-bit cygwin.
> 
> That's a good place to point to my extended "how to port to 64 bit" FAQ,
> starting here:
> 
>   http://cygwin.com/faq/faq.html#faq.programming.64bitporting
> 
> Please read this first.
> 
> Basically, what you see here...
> 
> > /usr/local/include/sqltypes.h:261:33: error: conflicting types for 'ULONG'
> >  typedef unsigned long           ULONG;
> >                                  ^
> > In file included from /usr/include/w32api/windows.h:69:0,
> >                  from dbdodbc.h:6,
> >                  from ODBC.h:8,
> >                  from ODBC.xs:1:
> > /usr/include/w32api/windef.h:25:27: note: previous declaration of 'ULONG' was here
> >  typedef unsigned __LONG32 ULONG;
> >                            ^
> > Makefile:390: recipe for target `ODBC.o' failed
> 
> ...is a typical type conflict.  ULONG is a Windows type defined as
> unsigned long in the Win32 API.  The Win32 data model is LLP64, so
> unsigned long is 4 bytes.  However, Cygwin is LP64, so unsigned long is
> 8 bytes.  Therefore the `typedef unsigned long ULONG;' is wrong for 64
> bit.  Either drop the definition entirely, or redefine it matching the
> data model:
> 
>   #ifdef __LP64__
>   typedef unsigned int ULONG;
>   #else
>   typedef unsigned long ULONG;
>   #endif

Btw., that's what the __LONG32 macro in the mingw-w64 headers is for...


Corinna

-- 
Corinna Vinschen                  Please, send mails regarding Cygwin to
Cygwin Maintainer                 cygwin AT cygwin DOT com
Red Hat

--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: building Perl module DBD-ODBC-4.3 under 64-bit cygwin
  2013-08-01 12:57 building Perl module DBD-ODBC-4.3 under 64-bit cygwin Simon Barnes
  2013-08-01 14:02 ` Corinna Vinschen
@ 2013-08-01 18:26 ` Yaakov (Cygwin/X)
  1 sibling, 0 replies; 5+ messages in thread
From: Yaakov (Cygwin/X) @ 2013-08-01 18:26 UTC (permalink / raw)
  To: cygwin

On 2013-08-01 07:57, Simon Barnes wrote:
> I'm having difficulty with this and would appreciate any suggestions.
> It does build under 32-bit cygwin.

Not really.  The included makefile tries to force Cygwin to use ODBC32, 
where we use iODBC; the conflicts between the two is what cause this 
error.  A patch to correctly build DBD::ODBC is in Ports:

http://cygwin-ports.git.sourceforge.net/git/gitweb.cgi?p=cygwin-ports/perl-DBD-ODBC;a=tree

A binary perl-DBD-ODBC is also available in the Ports repo.


Yaakov



--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple

^ permalink raw reply	[flat|nested] 5+ messages in thread

* RE: building Perl module DBD-ODBC-4.3 under 64-bit cygwin
       [not found] <3BA6644C396CE44F83F988D688C72A73015956B870@NL0230MBX08N1.DIR.slb.com>
@ 2013-08-02  7:11 ` Simon Barnes
  0 siblings, 0 replies; 5+ messages in thread
From: Simon Barnes @ 2013-08-02  7:11 UTC (permalink / raw)
  To: cygwin

> ...is a typical type conflict.  ULONG is a Windows type defined as
> unsigned long in the Win32 API.  The Win32 data model is LLP64, so
> unsigned long is 4 bytes.  However, Cygwin is LP64, so unsigned long is
> 8 bytes.  Therefore the `typedef unsigned long ULONG;' is wrong for 64
> bit.  Either drop the definition entirely, or redefine it matching the
> data model:
>
>    #ifdef __LP64__
>   typedef unsigned int ULONG;
>   #else
>   typedef unsigned long ULONG;
>   #endif

OK, managed to achieve a build with this.   And I'll keep on eye on cygwin ports.

Thanks
Simon

--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2013-08-02  7:11 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-08-01 12:57 building Perl module DBD-ODBC-4.3 under 64-bit cygwin Simon Barnes
2013-08-01 14:02 ` Corinna Vinschen
2013-08-01 15:16   ` Corinna Vinschen
2013-08-01 18:26 ` Yaakov (Cygwin/X)
     [not found] <3BA6644C396CE44F83F988D688C72A73015956B870@NL0230MBX08N1.DIR.slb.com>
2013-08-02  7:11 ` Simon Barnes

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).