php5.4 xdebug,Windows 中编译 PHP5.4 + xdebug

1.  error C2466: cannot allocate an array of constant size 0

用C/C++写PHP的扩展模块,如果VS2005编译,可能会出现下面的错误:

\VC\include\sys/stat.inl(44) : error C2466: 不能分配常量大小为 0 的数组

,出现这种情况时,只需在 \vc\include\malloc.h 文件中找到:

#define _STATIC_ASSERT(expr) typedef char __static_assert_t[ (expr) ]

并改成:

#ifdef PHP_WIN32

#define _STATIC_ASSERT(expr) typedef char __static_assert_t[ (expr)?(expr):1 ]

#else

#define _STATIC_ASSERT(expr) typedef char __static_assert_t[ (expr) ]

#endif

就可以了。

单独编译 pdo:

打开 VS2005 命令行工具

1)执行命令cscript /nologo configure.js --enable-pdo php error C2491: 'strnlen' : definition of dllimport function  https://bugs.php.net/bug.php?id=47787 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 2)ext\dom\php_dom.h(33) : fatal error C1083: Cannot open include file:  'libxml/parser.h': No such file or directory 修改 config 命令:cscript /nologo configure.js --enable-pdo --without-libxml 3)ext\calendar\jewish.c(324) : error C2001: newline in constant 关于 calendar.c 和 jewish.c 的编码问题: 这两个文件使用的是 ANSI 编码,包含有一些西文的特殊字符,GBK 字符集中不存在。 可用 editplus 打开,编码选择:West European (Windows),另存为 UTF-8。

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值