我正在尝试构建php_perl.dll并收到错误消息,但是我对构建这些扩展名的理解是有限的(显然)。因此,我需要对此进行编译,或者将我指向一个可以与PHP 5.2.17一起使用的预构建php_perl.dll。 http://pecl4win.php.net网站已死,我在http://pecl.php.net/package/perl上所能找到的东西也无济于事。
我已经安装了Perl(先试用64位,然后尝试x86),PHP(已随XAMPP一起安装)和Visual Studio6。Windows 7 64bit。 PERL_HOME设置为c:\ perl。
这个命令msdev perl.dsp /MAKE "perl - Win32 Release_TS"
导致102个错误,如下所示:
--------------------Configuration: perl - Win32 Release_TS--------------------
Compiling...
php_perl.c
C:\Perl\lib\CORE\sys/socket.h(72) : error C2061: syntax error : identifier 'win32_accept'
C:\Perl\lib\CORE\sys/socket.h(72) : error C2059: syntax error : ';'
C:\Perl\lib\CORE\sys/socket.h(72) : error C2146: syntax error : missing ')' before identifier 's'
C:\Perl\lib\CORE\sys/socket.h(72) : error C2061: syntax error : identifier 's'
C:\Perl\lib\CORE\sys/socket.h(72) : error C2059: syntax error : ','
C:\Perl\lib\CORE\sys/socket.h(72) : error C2059: syntax error : ')'
...
C:\Perl\lib\CORE\sys/socket.h(98) : error C2059: syntax error : ')'
C:\Perl\lib\CORE\win32.h(420) : error C2079: 'Wservent' uses undefined struct 'servent'
C:\Perl\lib\CORE\iperlsys.h(1143) : error C2143: syntax error : missing ')' before '*'
C:\Perl\lib\CORE\iperlsys.h(1143) : fatal error C1003: error count exceeds 100; stopping compilation
Error executing cl.exe.
php_perl.dll - 102 error(s), 0 warning(s)
最佳答案
这个问题没有答案吗?
我只是通过稍微修改新的1.0.1 php_perl.c源代码(第31行)来解决Windows上php 5.3.13的编译错误:
旧:
# define _WINSOCK2API_ /* using winsock.h instead of winsock2.h */
# ifndef _WINSOCK2API_
# include <winsock2.h>
# endif
setenv /xp /x86 /release
cd <root_directory>
bin\phpsdk_setvars.bat
cd <php_src>
buildconf --force
configure --help
configure --with-perl=shared --with-extra-includes="<perl_lib_CORE_directory>" --with-extra-libs="<perl_lib_CORE_directory>"
nmake php_perl.dll
https://stackoverflow.com/questions/7728714/
相关文章:
java - 编译时出现一个或多个错误的NetBeans项目
c++ - 新手Chrome插件开发人员需要NPAPI入门方面的帮助
compiler-construction - lex 使用来自 lex.yy.c 文件的 flex
objective-c - 尽管导入了正确的 header ,但使用自定义类的编译器错误
compiler-errors - nant 构建文件使用 nant 0.86 而不是 0.91 a
objective-c - UIAlertView dismissWithClickedButton