2011-11-07 8 views
2

PHP를위한 hello-world 유형 확장을 빌드하고 Windows7에서 visual studio 2008 express로 컴파일하려면 this tutorial을 따르고 있습니다. 내가 만들 때, 나는 이러한 오류를 얻을 :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 인 배열을 할당 할 수 없습니다. 정적 어설 션 매크로에서 사용되는 트릭입니다. 별로 유익하지 못하다.

관련 문제