2011-11-07 108 views
2

当我下面this tutorial打造的PHP你好世界类型的扩展名,并与Windows7的Visual Studio 2008速成编译。当我建,我得到这些错误:编译错误编译PHP扩展

  • 1有做分配大小0
  • 的常量数组的其他人似乎有时间做。

但我不知道他们的意思完全或如何解决这些问题。

Compiling... 
stdafx.cpp 
C:\Program\VS2008\VC\include\sys/stat.inl(44) : error C2466: cannot allocate an array of constant size 0 
C:\Program\VS2008\VC\include\sys/stat.inl(49) : error C2466: cannot allocate an array of constant size 0 
C:\Program\VS2008\VC\include\sys/utime.inl(39) : error C2466: cannot allocate an array of constant size 0 
C:\Program\VS2008\VC\include\sys/utime.inl(44) : error C2466: cannot allocate an array of constant size 0 
C:\Program\VS2008\VC\include\sys/utime.inl(49) : error C2466: cannot allocate an array of constant size 0 
C:\Program\VS2008\VC\include\sys/utime.inl(78) : error C2466: cannot allocate an array of constant size 0 
C:\Program\VS2008\VC\include\wtime.inl(37) : error C2664: '_wctime32' : cannot convert parameter 1 from 'const time_t *' to 'const __time32_t *' 
     Types pointed to are unrelated; conversion requires reinterpret_cast, C-style cast or function-style cast 
C:\Program\VS2008\VC\include\wtime.inl(43) : error C2664: 'errno_t _wctime32_s(wchar_t *,size_t,const __time32_t *)' : cannot convert parameter 3 from 'const time_t *' to 'const __time32_t *' 
     Types pointed to are unrelated; conversion requires reinterpret_cast, C-style cast or function-style cast 
C:\Program\VS2008\VC\include\time.inl(32) : warning C4244: 'argument' : conversion from 'time_t' to '__time32_t', possible loss of data 
C:\Program\VS2008\VC\include\time.inl(32) : warning C4244: 'argument' : conversion from 'time_t' to '__time32_t', possible loss of data 
C:\Program\VS2008\VC\include\time.inl(38) : error C2664: '_ctime32' : cannot convert parameter 1 from 'const time_t *' to 'const __time32_t *' 
     Types pointed to are unrelated; conversion requires reinterpret_cast, C-style cast or function-style cast 
C:\Program\VS2008\VC\include\time.inl(44) : error C2664: 'errno_t _ctime32_s(char *,size_t,const __time32_t *)' : cannot convert parameter 3 from 'const time_t *' to 'const __time32_t *' 
     Types pointed to are unrelated; conversion requires reinterpret_cast, C-style cast or function-style cast 
C:\Program\VS2008\VC\include\time.inl(51) : error C2664: '_gmtime32' : cannot convert parameter 1 from 'const time_t *' to 'const __time32_t *' 
     Types pointed to are unrelated; conversion requires reinterpret_cast, C-style cast or function-style cast 
C:\Program\VS2008\VC\include\time.inl(57) : error C2664: '_gmtime32_s' : cannot convert parameter 2 from 'const time_t *' to 'const __time32_t *' 
     Types pointed to are unrelated; conversion requires reinterpret_cast, C-style cast or function-style cast 
C:\Program\VS2008\VC\include\time.inl(64) : error C2664: '_localtime32' : cannot convert parameter 1 from 'const time_t *' to 'const __time32_t *' 
     Types pointed to are unrelated; conversion requires reinterpret_cast, C-style cast or function-style cast 
C:\Program\VS2008\VC\include\time.inl(69) : error C2664: '_localtime32_s' : cannot convert parameter 2 from 'const time_t *' to 'const __time32_t *' 
     Types pointed to are unrelated; conversion requires reinterpret_cast, C-style cast or function-style cast 
C:\Program\VS2008\VC\include\time.inl(81) : error C2664: '_time32' : cannot convert parameter 1 from 'time_t *' to '__time32_t *' 
     Types pointed to are unrelated; conversion requires reinterpret_cast, C-style cast or function-style cast 

回答

2

,如果你看一下文件的线,然后在STATIC_ASSERT的定义,这些其实都是STATIC_ASSERT失败,检查标准的类型名称匹配的尺寸特定的32个类型名称。在我看来,你有32位和64之间的不匹配位不知何故编译。

与不能分配大小为0的数组的业务是在静态断言宏使用的特技。信息量不大。