Skip Menu |
 

This queue is for tickets about the DBD-mysql CPAN distribution.

Report information
The Basics
Id: 28795
Status: resolved
Priority: 0/
Queue: DBD-mysql

People
Owner: CAPTTOFU [...] cpan.org
Requestors: bitcard [...] chimpychompy.org
Cc:
AdminCc:

Bug Information
Severity: Important
Broken in: 4.005
Fixed in: (no value)

Attachments
include_mysql_h.out



Subject: No ulong on OSX (dbdimp.c:1533: error: 'ulong' undeclared (first use in this function))
Download (untitled) / with headers
text/plain 1.8k
Trying to install 4.005 on OSX failed with the following: cp lib/DBD/mysql.pm blib/lib/DBD/mysql.pm cp lib/DBD/mysql/GetInfo.pm blib/lib/DBD/mysql/GetInfo.pm cp lib/DBD/mysql/INSTALL.pod blib/lib/DBD/mysql/INSTALL.pod cp lib/Bundle/DBD/mysql.pm blib/lib/Bundle/DBD/mysql.pm cc -c -I/Library/Perl/5.8.6/darwin-thread-multi-2level/auto/DBI - I/usr/local/mysql/include -Os -arch ppc -fno-common -DDBD_MYSQL_INSERT_ID_IS_GOOD -g -g -pipe -fno-common -DPERL_DARWIN -no-cpp-precomp -fno-strict-aliasing - I/usr/local/include -Os -DVERSION=\"4.005\" -DXS_VERSION=\"4.005\" "- I/System/Library/Perl/5.8.6/darwin-thread-multi-2level/CORE" dbdimp.c dbdimp.c: In function 'mysql_dr_connect': dbdimp.c:1533: error: 'ulong' undeclared (first use in this function) dbdimp.c:1533: error: (Each undeclared identifier is reported only once dbdimp.c:1533: error: for each function it appears in.) dbdimp.c:1533: error: parse error before numeric constant dbdimp.c:1535: error: parse error before numeric constant dbdimp.c:1649: error: parse error before numeric constant make: *** [dbdimp.o] Error 1 the broken line is: client_flag |= CLIENT_MULTI_STATEMENTS; In mysql_com.h, there is this, which uses ulong: #define CLIENT_MULTI_STATEMENTS (((ulong) 1) << 16) /* Enable/disable multi-stmt support */ But ulong is not known, so the build fails. Mysql have a ulong typedef in my_global.h: ./include/my_global.h:824:typedef unsigned long ulong; /* Short for unsigned long */ I added #include my_global.h to the top of dbdimp.c, and my build completed OK. My mysql version is 5.0.27, installed from the Mysql official packages for OSX. "This is perl, v5.8.6 built for darwin-thread-multi-2level (with 3 registered patches, see perl -V for more detail)" Darwin [name] 8.10.0 Darwin Kernel Version 8.10.0: Wed May 23 16:50:59 PDT 2007; root:xnu-792.21.3~1/RELEASE_PPC Power Macintosh powerpc
Download (untitled) / with headers
text/plain 2.3k
I can't duplicated this error on my own OS X setup. I even have tried adding my_global.h, but this fails because dbdimp.h includes mysql.h, which already takes care of defining mysql-specific types such as ulong. Adding my_global.h causes errors such as: /usr/local/mysql/include/mysql/my_global.h:645: error: redefinition of typedef 'my_socket' So, having mysql.h should take care of this. On Sat Aug 11 11:46:08 2007, gss wrote: Show quoted text
> Trying to install 4.005 on OSX failed with the following: > > cp lib/DBD/mysql.pm blib/lib/DBD/mysql.pm > cp lib/DBD/mysql/GetInfo.pm blib/lib/DBD/mysql/GetInfo.pm > cp lib/DBD/mysql/INSTALL.pod blib/lib/DBD/mysql/INSTALL.pod > cp lib/Bundle/DBD/mysql.pm blib/lib/Bundle/DBD/mysql.pm > cc -c -I/Library/Perl/5.8.6/darwin-thread-multi-2level/auto/DBI - > I/usr/local/mysql/include -Os -arch ppc -fno-common > -DDBD_MYSQL_INSERT_ID_IS_GOOD > -g -g -pipe -fno-common -DPERL_DARWIN -no-cpp-precomp > -fno-strict-aliasing - > I/usr/local/include -Os -DVERSION=\"4.005\" -DXS_VERSION=\"4.005\" > "- > I/System/Library/Perl/5.8.6/darwin-thread-multi-2level/CORE" > dbdimp.c > dbdimp.c: In function 'mysql_dr_connect': > dbdimp.c:1533: error: 'ulong' undeclared (first use in this function) > dbdimp.c:1533: error: (Each undeclared identifier is reported only > once > dbdimp.c:1533: error: for each function it appears in.) > dbdimp.c:1533: error: parse error before numeric constant > dbdimp.c:1535: error: parse error before numeric constant > dbdimp.c:1649: error: parse error before numeric constant > make: *** [dbdimp.o] Error 1 > > the broken line is: > > client_flag |= CLIENT_MULTI_STATEMENTS; > > In mysql_com.h, there is this, which uses ulong: > > #define CLIENT_MULTI_STATEMENTS (((ulong) 1) << 16) /* > Enable/disable multi-stmt > support */ > > But ulong is not known, so the build fails. > > Mysql have a ulong typedef in my_global.h: > > ./include/my_global.h:824:typedef unsigned long ulong; /* Short for > unsigned > long */ > > I added #include my_global.h to the top of dbdimp.c, and my build > completed OK. > > My mysql version is 5.0.27, installed from the Mysql official > packages for OSX. > > > "This is perl, v5.8.6 built for darwin-thread-multi-2level > (with 3 registered patches, see perl -V for more detail)" > > Darwin [name] 8.10.0 Darwin Kernel Version 8.10.0: Wed May 23 16:50:59 > PDT 2007; > root:xnu-792.21.3~1/RELEASE_PPC Power Macintosh powerpc
Download (untitled) / with headers
text/plain 713b
On Wed Dec 05 22:17:28 2007, CAPTTOFU wrote: Show quoted text
> I can't duplicated this error on my own OS X setup. I even have tried > adding my_global.h, but this fails because dbdimp.h includes mysql.h, > which already takes care of defining mysql-specific types such as ulong. > Adding my_global.h causes errors such as: > > /usr/local/mysql/include/mysql/my_global.h:645: error: redefinition of > typedef 'my_socket' > > So, having mysql.h should take care of this.
FWIW my mysql.h does not define ulong and does not pull in my_global.h. This is fink's current stable MySQL 5. http://pdb.finkproject.org/pdb/package.php/mysql?rel_id=10.4-i386-current-stable I've attached the output of gcc -E with "#include <mysql.h>".
Download (untitled) / with headers
text/plain 164b
OTOH including "my_global.h" does clash with mysql.h. I believe fink is being caught by this which effects 5.0.24 - 5.0.32. http://bugs.mysql.com/bug.php?id=22227
Download (untitled) / with headers
text/plain 501b
On Tue Jan 15 19:18:16 2008, MSCHWERN wrote: Show quoted text
> OTOH including "my_global.h" does clash with mysql.h. > > I believe fink is being caught by this which effects 5.0.24 - 5.0.32. > http://bugs.mysql.com/bug.php?id=22227
FWIW I worked around it by pasting this into dbdimp.h from my_global.h but I don't know what that's going to do post 5.0.32. #if !defined(HAVE_ULONG) && !defined(TARGET_OS_LINUX) && !defined(__USE_MISC) typedef unsigned long ulong; /* Short for unsigned long */ #endif
everything compiles fine on OS X now.


This service is sponsored and maintained by Best Practical Solutions and runs on Perl.org infrastructure.

Please report any issues with rt.cpan.org to rt-cpan-admin@bestpractical.com.