php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #60267 Compile failure with freetds 0.91
Submitted: 2011-11-11 13:31 UTC Modified: 2011-11-16 12:13 UTC
From: gnubug at billmann-edv dot net Assigned: felipe (profile)
Status: Closed Package: Compile Failure
PHP Version: 5.3.9RC1 OS: Linux
Private report: No CVE-ID: None
View Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
If you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: gnubug at billmann-edv dot net
New email:
PHP Version: OS:

 

 [2011-11-11 13:31 UTC] gnubug at billmann-edv dot net
Description:
------------
Trying to use PHP 5.3 (and 5.4) with the current FreeTDS 0.91 results in the following error message:

In file included from php-5.4.0RC1/ext/mssql/php_mssql.c:33:
php-5.4.0RC1/ext/mssql/php_mssql.h:69: error: redefinition of typedef 'LPBYTE'
include/sqlfront.h:35: note: previous declaration of 'LPBYTE' was here

It seems that FreeTDS expects PHP_MSSQL_API to be defined which isn't anymore as of PHP 5.3. Simply adding "#define PHP_MSSQL_API" to ext/mssql/php_mssql.h in line 24 solves this error...

I'm not sure whether this should be considered a PHP or FreeTDS problem...

Regards
Oliver


Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2011-11-11 23:23 UTC] felipe@php.net
I can't reproduce it.
 [2011-11-12 00:04 UTC] gnubug at billmann-edv dot net
strange...

I just tried it again with fresh copies from scratch resulting in the same error.

I simply configured PHP with

./configure --prefix=$HOME/install --with-mssql=$HOME/install

and the make ended with

In file included from /home/oliver/source/php-5.3.9RC1/ext/mssql/php_mssql.c:33:
/home/oliver/source/php-5.3.9RC1/ext/mssql/php_mssql.h:68: error: redefinition of typedef 'LPBYTE'
/home/oliver/install/include/sqlfront.h:35: note: previous declaration of 'LPBYTE' was here

Are you using an altered version of any of those two packages by chance?

Oliver
 [2011-11-16 10:27 UTC] art dot frela at gmail dot com
root@wf:/usr/local/src/php-5.3.8# make
/bin/sh /usr/local/src/php-5.3.8/libtool --silent --preserve-dup-deps --
mode=compile gcc  -Iext/mssql/ -I/usr/local/src/php-5.3.8/ext/mssql/ -
DPHP_ATOM_INC -I/usr/local/src/php-5.3.8/include -I/usr/local/src/php-5.3.8/main 
-I/usr/local/src/php-5.3.8 -I/usr/local/src/php-5.3.8/ext/date/lib -
I/usr/local/src/php-5.3.8/ext/ereg/regex -I/usr/include/libxml2 -
I/usr/local/freetds//include -I/usr/local/src/php-5.3.8/ext/sqlite3/libsqlite -
I/usr/local/src/php-5.3.8/TSRM -I/usr/local/src/php-5.3.8/Zend    -I/usr/include 
-g -O2 -fvisibility=hidden  -prefer-non-pic -c /usr/local/src/php-
5.3.8/ext/mssql/php_mssql.c -o ext/mssql/php_mssql.lo
In file included from /usr/local/src/php-5.3.8/ext/mssql/php_mssql.c:33:
/usr/local/src/php-5.3.8/ext/mssql/php_mssql.h:68: error: redefinition of 
typedef ‘LPBYTE’
/usr/local/freetds//include/sqlfront.h:35: note: previous declaration of 
‘LPBYTE’ was here
/usr/local/src/php-5.3.8/ext/mssql/php_mssql.c: In function 
‘php_mssql_get_column_content_without_type’:
/usr/local/src/php-5.3.8/ext/mssql/php_mssql.c:1120: warning: passing argument 1 
of ‘spprintf’ from incompatible pointer type
/usr/local/src/php-5.3.8/main/spprintf.h:40: note: expected ‘char **’ but 
argument is of type ‘unsigned char **’
make: *** [ext/mssql/php_mssql.lo] Ошибка 1

!!!!php 5.2.17 WORKING!!!!
 [2011-11-16 12:09 UTC] felipe@php.net
I checked the information, the reporter is right. FreeTDS was relying in the PHP_MSSQL_API which was removed from PHP in 2008 without the knowning about this check from FreeTDS. I'll restore the #define PHP_MSSQL_API again when using FreeTDS.
 [2011-11-16 12:13 UTC] felipe@php.net
Automatic comment from SVN on behalf of felipe
Revision: http://svn.php.net/viewvc/?view=revision&revision=319306
Log: - Fixed bug #60267 (Compile failure with freetds 0.91)
 [2011-11-16 12:13 UTC] felipe@php.net
This bug has been fixed in SVN.

Snapshots of the sources are packaged every three hours; this change
will be in the next snapshot. You can grab the snapshot at
http://snaps.php.net/.

 For Windows:

http://windows.php.net/snapshots/
 
Thank you for the report, and for helping us make PHP better.


 [2011-11-16 12:13 UTC] felipe@php.net
-Status: Open +Status: Closed -Assigned To: +Assigned To: felipe
 [2012-04-18 09:47 UTC] laruence@php.net
Automatic comment on behalf of felipe
Revision: http://git.php.net/?p=php-src.git;a=commit;h=595ac67a5220ea69b88b644d3af89cacadd2d53b
Log: - Fixed bug #60267 (Compile failure with freetds 0.91)
 [2012-06-29 08:27 UTC] emanuele dot coniglio at grupposme dot com
/usr/local/src/php-5.3.8/ext/mssql/php_mssql.h:68: error: redefinition of 
typedef ‘LPBYTE’
/usr/local/freetds//include/sqlfront.h:35: note: previous declaration of 
‘LPBYTE’ was here
/usr/local/src/php-5.3.8/ext/mssql/php_mssql.c: In function 
‘php_mssql_get_column_content_without_type’:
/usr/local/src/php-5.3.8/ext/mssql/php_mssql.c:1120: warning: passing argument 1 
of ‘spprintf’ from incompatible pointer type
/usr/local/src/php-5.3.8/main/spprintf.h:40: note: expected ‘char **’ but 
argument is of type ‘unsigned char **’
make: *** [ext/mssql/php_mssql.lo]

In this case i just resolved by comment the declaration line of mentioned LPBYTE in /usr/local/src/php-5.3.8/ext/mssql/php_mssql.h:68, that is already decleared in /usr/local/freetds//include/sqlfront.h, after that make works fine
and give me the mssql.so compiled,

php Version 5.3.3-7+squeeze13

Emanuele
 [2012-07-24 23:38 UTC] rasmus@php.net
Automatic comment on behalf of felipe
Revision: http://git.php.net/?p=php-src.git;a=commit;h=595ac67a5220ea69b88b644d3af89cacadd2d53b
Log: - Fixed bug #60267 (Compile failure with freetds 0.91)
 [2013-11-17 09:35 UTC] laruence@php.net
Automatic comment on behalf of felipe
Revision: http://git.php.net/?p=php-src.git;a=commit;h=595ac67a5220ea69b88b644d3af89cacadd2d53b
Log: - Fixed bug #60267 (Compile failure with freetds 0.91)
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Wed Dec 04 10:01:30 2024 UTC