2011-07-05 3 views
0

D 프로젝트의 lodepng (http://lodev.org/lodepng/) 컴파일에 약간의 문제가 있습니다.D lodepng 컴파일 오류

In Encode.d 컴파일러에서 어설 션 문을 예상하지 않는 다음 코드가 있습니다. 이 블록을 제거하면 문제가 해결됩니다.

Decode.d에서
invariant 
{ 
    assert(compressionLevel >=0 && compressionLevel <= 9, "invalid zlib compression level"); 
    assert(targetColorType == ColorType.Any || 
      targetColorType == ColorType.RGB || 
      targetColorType == ColorType.RGBA, "colortype is not supported"); 
} 

내가 오류와 함께, 더 많은 문제가있는 중간 라인 "선언자의 입출력 (값)에 대한 식별자"

info.backgroundColor.length = chunk.data.length/2; 
foreach(index, inout value; info.backgroundColor) 
    value = chunk.data[index * 2]; 

오래된 몇 가지 문제가 없습니까 여기서 구문을 수정하고 어떻게 수정합니까? D에서 간단한 방법으로 png 이미지를 만드는 다른 방법이 있습니까?

답변

0

불변의 문제에 대해서는 잘 모르겠지만 두 번째 문제는 "inout"을 "ref"(D2 구문 변경)로 바꾸면 해결됩니다.

+0

나는 그것을 시도했지만 컴파일러가 이러한 대체 후에 찾은 코드에 너무 많은 이상한 오류가 있었다. –