php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #47787 VC++ 2005 build error
Submitted: 2009-03-26 11:32 UTC Modified: 2009-03-31 07:26 UTC
From: dpage at pgadmin dot org Assigned:
Status: Not a bug Package: Compile Failure
PHP Version: 5.2.9 OS: Windows XP
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: dpage at pgadmin dot org
New email:
PHP Version: OS:

 

 [2009-03-26 11:32 UTC] dpage at pgadmin dot org
Description:
------------
Building 5.2.9 with VC++ 2005 results in the error:

main\spprintf.c(184) : error C2491: 'strnlen' : definition of dllimport function not allowed

This appears to be due to the change here: http://cvs.php.net/viewvc.cgi/php-src/main/spprintf.c?r1=1.25.2.2.2.14&r2=1.25.2.2.2.15

The issue is resolved by adding:

#define HAVE_STRNLEN 1

to win32/build/config.w32.h.in


Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2009-03-26 11:48 UTC] pajoye@php.net
Please try a 5.2's cvs version.

Also, 5.2 only supports VC6. Use 5.3 if you want to use a decent compiler :)
 [2009-03-26 13:34 UTC] dpage at pgadmin dot org
HEAD of the 5.2 branch fails at the beginning with:

bison.exe --output=Zend/zend_ini_parser.c -v -d -p ini_ Zend/zend_ini_parser.y
NMAKE : fatal error U1077: 'bison.exe' : return code '0xc0000135'

I get that from a straight CVS checkout and from a tarball from a modified version of makedist (modified to use the head of the 5.2 branch) on on my mac.

Unfortunately my windows box is a part of a bigger buildfarm, on which I can't do much in the way of debugging and testing other than to feed it new tarballs and see if they build or not.
 [2009-03-26 14:34 UTC] pajoye@php.net
on your mac?

The HAVE_STRNLEN  issue is already fixed in CVS.
 [2009-03-26 14:46 UTC] dpage at pgadmin dot org
I built the tarball from CVS on the mac (using a tweaked version of the makedist script) and then transferred it to the Windows build server.

Glad to see it's fixed anyway - thanks.
 [2009-03-26 14:59 UTC] pajoye@php.net
I don't think using the mac to checkout the code is a good idea (or tgz). You can simply fetch the snaps source from http://windows.php.net, the new lines will be correct (and bison will not cry).
 [2009-03-26 16:26 UTC] dpage at pgadmin dot org
I get the same bison error building the source tarball from http://windows.php.net/snapshots/
 [2009-03-31 07:22 UTC] jani@php.net
Sorry, but your problem does not imply a bug in PHP itself.  For a
list of more appropriate places to ask for help using PHP, please
visit http://www.php.net/support.php as this bug system is not the
appropriate forum for asking support questions.  Due to the volume
of reports we can not explain in detail here why your report is not
a bug.  The support channels will be able to provide an explanation
for you.

Thank you for your interest in PHP.


 [2009-03-31 07:26 UTC] dpage at pgadmin dot org
It obviously was a bug in PHP, given that a fix was committed to CVS which resolves precisely the problem I reported.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Wed Apr 24 11:01:30 2024 UTC