php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #66148 Does not compile with VC11 and VC9
Submitted: 2013-11-22 15:40 UTC Modified: 2013-11-24 11:10 UTC
From: phpdev at ehrhardt dot nl Assigned: mike (profile)
Status: Closed Package: pecl_http (PECL)
PHP Version: 5.5.6 OS: Windows
Private report: No CVE-ID: None
 [2013-11-22 15:40 UTC] phpdev at ehrhardt dot nl
Description:
------------
The 2.0 release does not compile with VC11 (PHP 5.5.6) or VC9 (PHP 5.4.22). 

Test script:
---------------
nmake php_http.dll

Actual result:
--------------
Error messages:

   Creating library Release\php_curl.lib and object Release\php_curl.exp
   Creating library Release\php_propro.lib and object Release\php_propro.exp
   Creating library Release\php_raphf.lib and object Release\php_raphf.exp
php_http_client_curl.c
c:\php-sdk\php55dev\ext\http\php_http_misc.h(101) : warning C4018: '<' : signed/
unsigned mismatch
ext\http\php_http_client_curl.c(1768) : error C2143: syntax error : missing ';'
before 'type'
ext\http\php_http_client_curl.c(1770) : error C2065: 'curl' : undeclared identif
ier
ext\http\php_http_client_curl.c(1770) : error C2223: left of '->useevents' must
point to struct/union
ext\http\php_http_client_curl.c(1783) : error C2065: 'curl' : undeclared identif
ier
ext\http\php_http_client_curl.c(1783) : error C2223: left of '->unfinished' must
 point to struct/union
NMAKE : fatal error U1077: '"C:\Program Files (x86)\Microsoft Visual Studio 11.0
\VC\BIN\cl.exe"' : return code '0x2'
Stop.

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2013-11-22 15:45 UTC] mike@php.net
Uhm... well no idea, sorry. MSVC sometimes freaks the shit out of me.
We'll probably have to wait for a patch from the Windows folks.
 [2013-11-22 15:47 UTC] mike@php.net
Maybe moving line 1768 to 1765 fixes that?
But if, you'll probably still need the config.w32 from trunk.
 [2013-11-22 15:53 UTC] phpdev at ehrhardt dot nl
Yesterday (before) the release I compiled from trunk with the same errors. That was about 10 hours after you promoted 2.0 to trunk. I will try trunk as I see you have tried to fix it.
 [2013-11-22 15:57 UTC] mike@php.net
The windows build box currently generates binaires successfully, though:
http://windows.php.net/downloads/pecl/snaps/http/2.0.0/
 [2013-11-22 16:00 UTC] phpdev at ehrhardt dot nl
But it that with Curl, Propo and Raphf enabled?
 [2013-11-22 16:11 UTC] phpdev at ehrhardt dot nl
Result after moving line 1768 to 1765: A few warnings, but it builds. Time for 2.0.1!

   Creating library Release\php_curl.lib and object Release\php_curl.exp
   Creating library Release\php_propro.lib and object Release\php_propro.exp
   Creating library Release\php_raphf.lib and object Release\php_raphf.exp
php_http_client_curl.c
c:\php-sdk\php55dev\ext\http\php_http_misc.h(101) : warning C4018: '<' : signed/
unsigned mismatch
libcurl_a.lib(inflate.obj) : warning LNK4006: _inflateInit2_ already defined in
php5.lib(php5.dll); second definition ignored
libcurl_a.lib(inflate.obj) : warning LNK4006: _inflate already defined in php5.l
ib(php5.dll); second definition ignored
libcurl_a.lib(inflate.obj) : warning LNK4006: _inflateEnd already defined in php
5.lib(php5.dll); second definition ignored
libcurl_a.lib(inflate.obj) : warning LNK4006: _inflateCopy already defined in ph
p5.lib(php5.dll); second definition ignored
libcurl_a.lib(zutil.obj) : warning LNK4006: _zlibVersion already defined in php5
.lib(php5.dll); second definition ignored
libcurl_a.lib(zutil.obj) : warning LNK4006: _zError already defined in php5.lib(
php5.dll); second definition ignored
   Creating library Release\php_http.lib and object Release\php_http.exp
LINK : warning LNK4098: defaultlib 'LIBCMT' conflicts with use of other libs; us
e /NODEFAULTLIB:library
Release\php_http.dll : warning LNK4088: image being generated due to /FORCE opti
on; image may not run
EXT http build complete
 [2013-11-22 16:32 UTC] mike@php.net
Yep, pecl_http-2 cannot be built without raphf and propro.

Those linker warnings can be ignored, though. There here since pecl_http links against zlib (early 0. versions).

Before packagaing a 2.0.1 with a fix for a symptom, knowledge about the cause would be awesome though.
 [2013-11-22 16:42 UTC] phpdev at ehrhardt dot nl
Is not 	php_http_client_curl_t *curl a declaration? For MSVC they must be at the beginnen of a block. I will test now if this works as well:

static int php_http_client_curl_once(php_http_client_t *h)
{
	php_http_client_curl_t *curl;
	TSRMLS_FETCH_FROM_CTX(h->ts);

#if PHP_HTTP_HAVE_EVENT
	curl = h->ctx;

BTW: I ran into Propro and aphf yesterday. For Windows users: php_propro.dll and php_raphf.dll must be loaded before php_http.dll.
 [2013-11-22 16:51 UTC] phpdev at ehrhardt dot nl
I checked the php_http.dll from the windows build box. That one does not have libevent support (and is 719KB). My build has libevent 2.0.21-stable and is 791KB).
 [2013-11-22 17:35 UTC] phpdev at ehrhardt dot nl
I now have the code below, which builds fine for PHP 5.3.28-dev, 5.4.22 and 5.5.6.

static STATUS php_http_client_curl_exec(php_http_client_t *h)
{
	php_http_client_curl_t *curl;
	TSRMLS_FETCH_FROM_CTX(h->ts);

#if PHP_HTTP_HAVE_EVENT
	curl = h->ctx;
 [2013-11-23 23:00 UTC] phpdev at ehrhardt dot nl
-Status: Open +Status: Closed
 [2013-11-23 23:00 UTC] phpdev at ehrhardt dot nl
OK, you moved to git and fixed the issue. Thanks Mike and Anatol.
 [2013-11-24 11:10 UTC] mike@php.net
-Assigned To: +Assigned To: mike
 [2013-11-24 11:10 UTC] mike@php.net
yes the move to git was long  due.

anatol had a deeper look based on your report, thanks!
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sat Dec 14 00:01:26 2024 UTC