Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

I have a problem, compile ext on windows #1366

Closed
zhiephie opened this issue Dec 5, 2016 · 8 comments
Closed

I have a problem, compile ext on windows #1366

zhiephie opened this issue Dec 5, 2016 · 8 comments
Labels

Comments

@zhiephie
Copy link

zhiephie commented Dec 5, 2016

I'm following step by step at here

Using
php : php 7.0.13
visual studio 2015

This error

C:\zephir\parser\parser>type parser.php5.c  1>parser.c

C:\zephir\parser\parser>type base.c  1>>parser.c
'c:\php_devpack\phpize' is not recognized as an internal or external command,
operable program or batch file.
Preparing for parser compilation...
'c:\php_devpack\phpize' is not recognized as an internal or external command,
operable program or batch file.
C:\zephir\parser\configure.js(2106, 3) Microsoft JScript runtime error: Path not
 found

Compiling the parser...

Microsoft (R) Program Maintenance Utility Version 14.00.24210.0
Copyright (C) Microsoft Corporation.  All rights reserved.

PHP Warning:  copy(Release/php_zephir_parser.dll): failed to open stream: No suc
h file or directory in C:\zephir\Library\Compiler.php on line 256

Warning: copy(Release/php_zephir_parser.dll): failed to open stream: No such fil
e or directory in C:\zephir\Library\Compiler.php on line 256
Zephir\Exception: The zephir parser extension could not be found or compiled!

c:\compiler\utils>php -v
PHP 7.0.13 (cli) (built: Nov  8 2016 13:45:26) ( NTS )
Copyright (c) 1997-2016 The PHP Group
Zend Engine v3.0.0, Copyright (c) 1998-2016 Zend Technologies

c:\compiler\utils>
@sergeyklay
Copy link
Member

'c:\php_devpack\phpize' is not recognized as an internal or external command

It seems you have to install php devel pack from
http://windows.php.net/downloads/releases/

@zhiephie
Copy link
Author

zhiephie commented Dec 6, 2016

Okay, phpize not issue now, but new problem it

C:\zephir\parser\parser>type base.c  1>>parser.c
Preparing for parser compilation...
Compiling the parser...

Microsoft (R) Program Maintenance Utility Version 14.00.24210.0
Copyright (C) Microsoft Corporation.  All rights reserved.

NMAKE : fatal error U1077: '"C:\Program Files\Microsoft Visual Studio 14.0\VC\BI
N\cl.exe"' : return code '0x2'
Stop.

        "cl.exe" /D COMPILE_DL_ZEPHIR_PARSER /D ZEPHIR_PARSER_EXPORTS=1 -IC:\zep
hir\parser /nologo /I c:\php_devpack/include /I c:\php_devpack/include/main /I c
:\php_devpack/include/Zend /I c:\php_devpack/include/TSRM /I c:\php_devpack/incl
ude/ext /D _WINDOWS /D ZEND_WIN32=1 /D PHP_WIN32=1 /D WIN32 /D _MBCS /W3 /FD /wd
4996 /D_USE_32BIT_TIME_T=1 /guard:cf /MP /LD /MD /W3 /Ox /D NDebug /D NDEBUG /D
ZEND_WIN32_FORCE_INLINE /GF /D ZEND_DEBUG=0 /I "C:\zephir\parser\no\include" /Fo
C:\zephir\parser\Release\\ /FpC:\zephir\parser\Release\\ /FRC:\zephir\parser\Rel
ease\\ /FdC:\zephir\parser\Release\\ /c C:\zephir\parser\zephir_parser.c
zephir_parser.c
        "cl.exe" /D COMPILE_DL_ZEPHIR_PARSER /D ZEPHIR_PARSER_EXPORTS=1 -IC:\zep
hir\parser /nologo /I c:\php_devpack/include /I c:\php_devpack/include/main /I c
:\php_devpack/include/Zend /I c:\php_devpack/include/TSRM /I c:\php_devpack/incl
ude/ext /D _WINDOWS /D ZEND_WIN32=1 /D PHP_WIN32=1 /D WIN32 /D _MBCS /W3 /FD /wd
4996 /D_USE_32BIT_TIME_T=1 /guard:cf /MP /LD /MD /W3 /Ox /D NDebug /D NDEBUG /D
ZEND_WIN32_FORCE_INLINE /GF /D ZEND_DEBUG=0 /I "C:\zephir\parser\no\include" /Fo
C:\zephir\parser\Release\\ /FpC:\zephir\parser\Release\\ /FRC:\zephir\parser\Rel
ease\\ /FdC:\zephir\parser\Release\\ /c C:\zephir\parser\parser\parser.c C:\zeph
ir\parser\parser\scanner.c
parser.c
c:\zephir\parser\parser\parser.php5.inc.h(13): warning C4013: 'MAKE_STD_ZVAL' un
defined; assuming extern returning int
c:\zephir\parser\parser\parser.php5.inc.h(21): warning C4002: too many actual pa
rameters for macro 'ZVAL_STRING'
c:\zephir\parser\parser\parser.php5.inc.h(22): warning C4002: too many actual pa
rameters for macro 'zend_hash_add'
c:\zephir\parser\parser\parser.php5.inc.h(22): warning C4090: 'function': differ
ent 'const' qualifiers
c:\zephir\parser\parser\parser.php5.inc.h(22): warning C4047: 'function': 'zval
*' differs in levels of indirection from 'std::size_t'
c:\zephir\parser\parser\parser.php5.inc.h(22): warning C4024: '_zend_hash_add':
different types for formal and actual parameter 3
c:\zephir\parser\parser\parser.php5.inc.h(28): warning C4002: too many actual pa
rameters for macro 'ZVAL_STRING'
c:\zephir\parser\parser\parser.php5.inc.h(29): warning C4002: too many actual pa
rameters for macro 'zend_hash_add'
c:\zephir\parser\parser\parser.php5.inc.h(29): warning C4090: 'function': differ
ent 'const' qualifiers
c:\zephir\parser\parser\parser.php5.inc.h(29): warning C4047: 'function': 'zval
*' differs in levels of indirection from 'std::size_t'
c:\zephir\parser\parser\parser.php5.inc.h(29): warning C4024: '_zend_hash_add':
different types for formal and actual parameter 3
c:\zephir\parser\parser\parser.php5.inc.h(37): warning C4002: too many actual pa
rameters for macro 'zend_hash_add'
c:\zephir\parser\parser\parser.php5.inc.h(37): warning C4090: 'function': differ
ent 'const' qualifiers
c:\zephir\parser\parser\parser.php5.inc.h(37): warning C4047: 'function': 'zval
*' differs in levels of indirection from 'std::size_t'
c:\zephir\parser\parser\parser.php5.inc.h(37): warning C4024: '_zend_hash_add':
different types for formal and actual parameter 3
c:\zephir\parser\parser\parser.php5.inc.h(41): warning C4002: too many actual pa
rameters for macro 'zend_hash_add'
c:\zephir\parser\parser\parser.php5.inc.h(41): warning C4090: 'function': differ
ent 'const' qualifiers
c:\zephir\parser\parser\parser.php5.inc.h(41): warning C4047: 'function': 'zval
*' differs in levels of indirection from 'std::size_t'
c:\zephir\parser\parser\parser.php5.inc.h(41): warning C4024: '_zend_hash_add':
different types for formal and actual parameter 3
c:\zephir\parser\parser\parser.php5.inc.h(50): warning C4013: 'ALLOC_INIT_ZVAL'
undefined; assuming extern returning int
c:\zephir\parser\parser\parser.php5.inc.h(51): warning C4002: too many actual pa
rameters for macro 'ZVAL_STRING'
c:\zephir\parser\parser\parser.php5.inc.h(587): warning C4047: 'function': 'Hash
Position *' differs in levels of indirection from 'void **'
c:\zephir\parser\parser\parser.php5.inc.h(587): warning C4024: 'zend_hash_get_cu
rrent_data_ex': different types for formal and actual parameter 2
c:\zephir\parser\parser\parser.php5.inc.h(587): warning C4020: 'zend_hash_get_cu
rrent_data_ex': too many actual parameters
c:\zephir\parser\parser\parser.php5.inc.h(587): warning C4047: '==': 'zval *' di
ffers in levels of indirection from 'int'
c:\zephir\parser\parser\parser.php5.inc.h(588): warning C4013: 'Z_ADDREF_PP' und
efined; assuming extern returning int
c:\zephir\parser\parser\parser.php5.inc.h(592): warning C4047: 'function': 'zval
 *' differs in levels of indirection from 'zval **'
c:\zephir\parser\parser\parser.php5.inc.h(592): warning C4024: '_zval_ptr_dtor':
 different types for formal and actual parameter 1
parser.php5.lemon(93): error C2440: '=': cannot convert from 'zval *' to 'zval'
parser.php5.lemon(80): error C2440: '=': cannot convert from 'zval *' to 'zval'
scanner.c
scanner.re(30): warning C4101: 'next': unreferenced local variable
Generating Code...

PHP Warning:  copy(Release/php_zephir_parser.dll): failed to open stream: No suc
h file or directory in C:\zephir\Library\Compiler.php on line 256

Warning: copy(Release/php_zephir_parser.dll): failed to open stream: No such fil
e or directory in C:\zephir\Library\Compiler.php on line 256
Zephir\Exception: The zephir parser extension could not be found or compiled!

@sergeyklay Did you know this problem?

@sergeyklay
Copy link
Member

sergeyklay commented Dec 6, 2016

parser.php5.lemon(93): error C2440
parser.php5.lemon(80)

Now you use PHP 5 sources for PHP 7

@zhiephie
Copy link
Author

zhiephie commented Dec 6, 2016

Not, I'm use PHP 7, but zephir detected PHP 5

c:\compiler\utils>php -v
PHP 7.0.13 (cli) (built: Nov  8 2016 13:45:26) ( NTS )
Copyright (c) 1997-2016 The PHP Group
Zend Engine v3.0.0, Copyright (c) 1998-2016 Zend Technologies

c:\compiler\utils>

@zhiephie
Copy link
Author

zhiephie commented Dec 6, 2016

Many Thanks @sergeyklay, Work it!

@zhiephie zhiephie closed this as completed Dec 6, 2016
@gouchaoer
Copy link

gouchaoer commented Dec 28, 2016

@zhiephie
hey, I also run into this problem

c:\zephir\parser\parser\parser.php5.inc.h(13): warning C4013: 'MAKE_STD_ZVAL' un
defined; assuming extern returning int

my environment is win7, php7.0.12, vs2015...

how do you solve the problem?

@zhiephie
Copy link
Author

Configure in DIR zephir\parser\parser\build_win32.bat

edit

lemon -s parser.php7.lemon
type parser.php7.c > parser.c

@gouchaoer
Copy link

@zhiephie it works!!!

@sergeyklay please try to change the build_win32 to automatically decide which php version to use. thx.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants