2011-11-07 14 views
2

私はthis tutorialの後ろにphp用のhello-world型拡張をビルドし、Windows7上のvisual studio 2008 expressでコンパイルします。私はビルドすると、私はこれらのエラーを取得: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は、静的なアサートマクロで使用されるトリックです。あまり有益ではありません。

関連する問題