开发者

cabal doesn't include c header files

I just installed the most recent version of the Haskell Platform (2011.something) on Mac OS X 10.6.7.

I seems that cabal doesn't include c header files properly.

E.g. when attempting to install cryptohash i get the following error:

Resolving dependencies...
Configuring cryptohash-0.7.0...
Preprocessing library cryptohash-0.7.0...
Preprocessing executables for cryptohash-0.7.0...
Building cryptohash-0.7.0...
[ 1 of 13] Compiling Crypto.Hash.Tiger ( Crypto/Hash/Tiger.hs, dist/build/Crypto/Hash/Tiger.o )
[ 2 of 13] Compiling Crypto.Hash.Skein512 ( Crypto/Hash/Skein512.hs, dist/build/Crypto/Hash/Skein512.o )
[ 3 of 13] Compiling Crypto.Hash.Skein256 ( Crypto/Hash/Skein256.hs, dist/build/Crypto/Hash/Skein256.o )
[ 4 of 13] Compiling Crypto.Hash.RIPEMD160 ( Crypto/Hash/RIPEMD160.hs, dist/build/Crypto/Hash/RIPEMD160.o )
[ 5 of 13] Compiling Crypto.Hash.MD5  ( Crypto/Hash/MD5.hs, dist/build/Crypto/Hash/MD5.o )
[ 6 of 13] Compiling Crypto.Hash.MD4  ( Crypto/Hash/MD4.hs, dist/build/Crypto/Hash/MD4.o )
[ 7 of 13] Compiling Crypto.Hash.MD2  ( Crypto/Hash/MD2.hs, dist/build/Crypto/Hash/MD2.o )
[ 8 of 13] Compiling Crypto.Hash.SHA512 ( Crypto/Hash/SHA512.hs, dist/build/Crypto/Hash/SHA512.o )
[ 9 of 13] Compiling Crypto.Hash.SHA512t ( Crypto/Hash/SHA512t.hs, dist/build/Crypto/Hash/SHA512t.o )
[10 of 13] Compiling Crypto.Hash.SHA384 ( Crypto/Hash/SHA384.hs, dist/build/Crypto/Hash/SHA384.o )
[11 of 13] Compiling Crypto.Hash.SHA256 ( Crypto/Hash/SHA256.hs, dist/build/Crypto/Hash/SHA256.o )
[12 of 13] Compiling Crypto.Hash.SHA224 ( Crypto/Hash/SHA224.hs, dist/build/Crypto/Hash/SHA224.o )
[13 of 13] Compiling Crypto.Hash.SHA1 ( Crypto/Hash/SHA1.hs, dist/build/Crypto/Hash/SHA1.o )
[ 1 of 13] Compiling Crypto.Hash.Tiger ( Crypto/Hash/Tiger.hs, dist/build/Crypto/Hash/Tiger.p_o )
[ 2 of 13] Compiling Crypto.Hash.Skein512 ( Crypto/Hash/Skein512.hs, dist/build/Crypto/Hash/Skein512.p_o )
[ 3 of 13] Compiling Crypto.Hash.Skein256 ( Crypto/Hash/Skein256.hs, dist/build/Crypto/Hash/Skein256.p_o )
[ 4 of 13] Compiling Crypto.Hash.RIPEMD160 ( Crypto/Hash/RIPEMD160.hs, dist/build/Crypto/Hash/RIPEMD160.p_o )
[ 5 of 13] Compiling Crypto.Hash.MD5  ( Crypto/Hash/MD5.hs, dist/build/Crypto/Hash/MD5.p_o )
[ 6 of 13] Compiling Crypto.Hash.MD4  ( Crypto/Hash/MD4.hs, dist/build/Crypto/Hash/MD4.p_o )
[ 7 of 13] Compiling Crypto.Hash.MD2  ( Crypto/Hash/MD2.hs, dist/build/Crypto/Hash/MD2.p_o )
[ 8 of 13] Compiling Crypto.Hash.SHA512 ( Crypto/Hash/SHA512.hs, dist/build/Crypto/Hash/SHA512.p_o )
[ 9 of 13] Compiling Crypto.Hash.SHA512t ( Crypto/Hash/SHA512t.hs, dist/build/Crypto/Hash/SHA512t.p_o )
[10 of 13] Compiling Crypto.Hash.SHA384 ( Crypto/Hash/SHA384.hs, dist/build/Crypto/Hash/SHA384.p_o )
[11 of 13] Compiling Crypto.Hash.SHA256 ( Crypto/Hash/SHA256.hs, dist/build/Crypto/Hash/SHA256.p_o )
[12 of 13] Compiling Crypto.Hash.SHA224 ( Crypto/Hash/SHA224.hs, dist/build/Crypto/Hash/SHA224.p_o )
[13 of 13] Compiling Crypto.Hash.SHA1 ( Crypto/Hash/SHA1.hs, dist/build/Crypto/Hash/SHA1.p_o )

cbits/sha1.c:25:20:  error: string.h: No such file or directory

In file included from cbits/sha1.c:26:0: 

cbits/sha1.h:27:20:  error: stdint.h: No such file or directory

In file included from cbits/sha1.c:26:0: 

cbits/sha1.h:31:0:
     error: expected specifier-qualifier-list before ‘uint64_t’

cbits/sha1.h:40:0:
     error: expected declaration specifiers or ‘...’ before ‘uint8_t’

cbits/sha1.h:40:0:
     error: expected declaration specifiers or ‘...’ before ‘uint32_t’

cbits/sha1.h:41:0:
     error: expected declaration specifiers or ‘...’ before ‘uint8_t’

In file included from cbits/sha1.c:27:0: 

cbits/bitfn.h:33:0:
     error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘bitfn_swap32’

cbits/bitfn.h:72:0:
     error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘rol32’

cbits/bitfn.h:79:0:
     error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘ror32’

cbits/bitfn.h:86:0:
     error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘rol64’

cbits/bitfn.h:93:0:
     error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘ror64’

cbits/bitfn.h:107:0:  error: expected ‘)’ before ‘*’ token

cbits/bitfn.h:115:0:
     error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘bitfn_swap64’

cbits/bitfn.h:123:0:  error: expected ‘)’ before ‘*’ token

cbits/bitfn.h:131:0:
     error: expected declaration specifiers or ‘...’ before ‘uint32_t’
cbits/bitfn.h: In function ‘memory_zero’:

cbits/bitfn.h:133:0:
     error: ‘uint32_t’ undeclared (first use in this function)

cbits/bitfn.h:133:0:
     error: (Each undeclared identifier is reported only once

cbits/bitfn.h:133:0:  error: for each function it appears in.)

cbits/bitfn.h:133:0:
     error: ‘ptr32’ undeclared (first use in this function)

cbits/bitfn.h:134:0:
     error: ‘uint8_t’ undeclared (first use in this function)

cbits/bitfn.h:134:0:
     error: ‘ptr8’ undeclared (first use in this function)

cbits/bitfn.h:137:0:
     error: ‘len’ undeclared (first use in this function)

cbits/bitfn.h:140:0:  error: expected expression before ‘)’ token
cbits/bitfn.h: At top level:

cbits/bitfn.h:148:0:  error: expected ‘)’ before ‘*’ token

cbits/bitfn.h:155:0:  error: expected ‘)’ before ‘*’ token

In file included from cbits/sha1.c:27:0: 

cbits/bitfn.h:169:31:
     error: machine/endian.h: No such file or directory
cbits/sha1.c: In function ‘sha1_init’:

cbits/sha1.c:31:0:
     warning: implicit declaration of function ‘memset’

cbits/sha1.c:31:0:
     warning: incompatible implicit declaration of built-in function ‘memset’

cbits/sha1.c:33:0:
     error: ‘struct sha1_ctx’ has no member named ‘h’

cbits/sha1.c:34:0:
     error: ‘struct sha1_ctx’ has no member named ‘h’

cbits/sha1.c:35:0:
     error: ‘struct sha1_ctx’ has no member named ‘h’

cbits/sha1.c:36:0:
     error: ‘struct sha1_ctx’ has no member named ‘h’

cbits/sha1.c:37:0:
     error: ‘struct sha1_ctx’ has no member named ‘h’
cbits/sha1.c: At top level:

cbits/sha1.c:56:0:
     error: expected declaration specifiers or ‘...’ before ‘uint32_t’
cbits/sha1.c: In function ‘sha1_do_chunk’:

cbits/sha1.c:58:0:
     error: ‘uint32_t’ undeclared (first use in this function)

cbits/sha1.c:58:0:  error: expected ‘;’ before ‘a’

cbits/sha1.c:59:0:  error: expected ‘;’ before ‘w’

cbits/sha1.c:61:0:
     error: ‘w’ undeclared (first use in this function)

cbits/sha1.c:61:0:
     warning: implicit declaration of function ‘bitfn_swap32’

cbits/sha1.c:61:0:
     error: ‘buf’ undeclared (first use in this function)

cbits/sha1.c:65:0:
     error: ‘a’ undeclared (first use in this function)

cbits/sha1.c:65:0:
     error: ‘struct sha1_ctx’ has no member named ‘h’

cbits/sha1.c:65:0:
     error: ‘b’ undeclared (first use in this function)

cbits/sha1.c:65:0:
     error: ‘struct sha1_ctx’ has no member named ‘h’

cbits/sha1.c:65:0:
     error: ‘c’ undeclared (first use in this function)

cbits开发者_运维百科/sha1.c:65:0:
     error: ‘struct sha1_ctx’ has no member named ‘h’

cbits/sha1.c:65:0:
     error: ‘d’ undeclared (first use in this function)

cbits/sha1.c:65:0:
     error: ‘struct sha1_ctx’ has no member named ‘h’

cbits/sha1.c:65:0:
     error: ‘e’ undeclared (first use in this function)

cbits/sha1.c:65:0:
     error: ‘struct sha1_ctx’ has no member named ‘h’

cbits/sha1.c:67:0:
     warning: implicit declaration of function ‘rol32’

cbits/sha1.c:151:0:
     error: ‘struct sha1_ctx’ has no member named ‘h’

cbits/sha1.c:152:0:
     error: ‘struct sha1_ctx’ has no member named ‘h’

cbits/sha1.c:153:0:
     error: ‘struct sha1_ctx’ has no member named ‘h’

cbits/sha1.c:154:0:
     error: ‘struct sha1_ctx’ has no member named ‘h’

cbits/sha1.c:155:0:
     error: ‘struct sha1_ctx’ has no member named ‘h’
cbits/sha1.c: At top level:

cbits/sha1.c:158:0:
     error: expected declaration specifiers or ‘...’ before ‘uint8_t’

cbits/sha1.c:158:0:
     error: expected declaration specifiers or ‘...’ before ‘uint32_t’
cbits/sha1.c: In function ‘sha1_update’:

cbits/sha1.c:160:0:
     error: ‘uint32_t’ undeclared (first use in this function)

cbits/sha1.c:160:0:  error: expected ‘;’ before ‘index’

cbits/sha1.c:162:0:
     error: ‘index’ undeclared (first use in this function)

cbits/sha1.c:162:0:
     error: ‘struct sha1_ctx’ has no member named ‘sz’

cbits/sha1.c:163:0:
     error: ‘to_fill’ undeclared (first use in this function)

cbits/sha1.c:165:0:
     error: ‘struct sha1_ctx’ has no member named ‘sz’

cbits/sha1.c:165:0:
     error: ‘len’ undeclared (first use in this function)

cbits/sha1.c:169:0:
     warning: implicit declaration of function ‘memcpy’

cbits/sha1.c:169:0:
     warning: incompatible implicit declaration of built-in function ‘memcpy’

cbits/sha1.c:169:0:
     error: ‘struct sha1_ctx’ has no member named ‘buf’

cbits/sha1.c:169:0:
     error: ‘data’ undeclared (first use in this function)

cbits/sha1.c:170:0:  error: expected expression before ‘)’ token

cbits/sha1.c:170:0:
     error: too many arguments to function ‘sha1_do_chunk’

cbits/sha1.c:178:0:  error: expected expression before ‘)’ token

cbits/sha1.c:178:0:
     error: too many arguments to function ‘sha1_do_chunk’

cbits/sha1.c:182:0:
     warning: incompatible implicit declaration of built-in function ‘memcpy’

cbits/sha1.c:182:0:
     error: ‘struct sha1_ctx’ has no member named ‘buf’
cbits/sha1.c: At top level:

cbits/sha1.c:185:0:
     error: expected declaration specifiers or ‘...’ before ‘uint8_t’
cbits/sha1.c: In function ‘sha1_finalize’:

cbits/sha1.c:187:0:
     error: nested functions are disabled, use -fnested-functions to re-enable

cbits/sha1.c:187:0:
     error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘padding’

cbits/sha1.c:187:0:
     error: ‘padding’ undeclared (first use in this function)

cbits/sha1.c:187:0:  error: expected expression before ‘{’ token

cbits/sha1.c:188:0:
     error: ‘uint64_t’ undeclared (first use in this function)

cbits/sha1.c:188:0:  error: expected ‘;’ before ‘bits’

cbits/sha1.c:189:0:
     error: ‘uint32_t’ undeclared (first use in this function)

cbits/sha1.c:189:0:  error: expected ‘;’ before ‘index’

cbits/sha1.c:190:0:
     error: ‘p’ undeclared (first use in this function)

cbits/sha1.c:190:0:  error: expected expression before ‘)’ token

cbits/sha1.c:193:0:
     error: ‘bits’ undeclared (first use in this function)

cbits/sha1.c:193:0:
     warning: implicit declaration of function ‘bitfn_swap64’

cbits/sha1.c:193:0:
     error: ‘struct sha1_ctx’ has no member named ‘sz’

cbits/sha1.c:196:0:
     error: ‘index’ undeclared (first use in this function)

cbits/sha1.c:196:0:
     error: ‘struct sha1_ctx’ has no member named ‘sz’

cbits/sha1.c:197:0:
     error: ‘padlen’ undeclared (first use in this function)

cbits/sha1.c:198:0:
     error: too many arguments to function ‘sha1_update’

cbits/sha1.c:201:0:
     error: ‘uint8_t’ undeclared (first use in this function)

cbits/sha1.c:201:0:  error: expected expression before ‘)’ token

cbits/sha1.c:201:0:
     error: too many arguments to function ‘sha1_update’

cbits/sha1.c:204:0:
     error: ‘struct sha1_ctx’ has no member named ‘h’

cbits/sha1.c:205:0:
     error: ‘struct sha1_ctx’ has no member named ‘h’

cbits/sha1.c:206:0:
     error: ‘struct sha1_ctx’ has no member named ‘h’

cbits/sha1.c:207:0:
     error: ‘struct sha1_ctx’ has no member named ‘h’

cbits/sha1.c:208:0:
     error: ‘struct sha1_ctx’ has no member named ‘h’
cabal: Error: some packages failed to install:
cryptohash-0.7.0 failed during the building phase. The exception was:
ExitFailure 1

How do i fix this?


Just to lock the answer in: this is a bug in a version of the Haskell Platform related to XCode 4. http://trac.haskell.org/haskell-platform/ticket/163

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜