我无法使用cabal
安装许多不同的内容,因为它们依赖于无法安装的network-2.4.0.1
:
Preprocessing library network-2.4.0.1...
Socket.hsc: In function ‘main’:
Socket.hsc:1054: error: invalid application of ‘sizeof’ to incomplete type ‘struct ucred’
Socket.hsc:1054: error: invalid application of ‘sizeof’ to incomplete type ‘struct ucred’
Socket.hsc:1054: error: invalid application of ‘sizeof’ to incomplete type ‘struct ucred’
Socket.hsc:1060: error: invalid use of undefined type ‘struct ucred’
Socket.hsc:1061: error: invalid use of undefined type ‘struct ucred’
Socket.hsc:1062: error: invalid use of undefined type ‘struct ucred’
compiling dist/build/Network/Socket_hsc_make.c failed (exit code 1)
有关如何进行的任何线索? (我在Ubuntu 10.04上使用Haskell Platform 2012.2.0.0)。
一些谷歌搜索显示这是cabal-install-1.11
的问题,但尝试更新它
受到依赖于...... network-2.4.0.1
!
Per @ Yuras @ suggestion,这是cabal -v install network
部分附近configure
的输出:
checking for struct msghdr.msg_control... yes
checking for struct msghdr.msg_accrights... no
checking for struct sockaddr.sa_len... no
checking for in_addr_t in netinet/in.h... yes
checking for SO_PEERCRED and struct ucred in sys/socket.h... yes
checking for _head_libws2_32_a in -lws2_32... no
checking for getaddrinfo... yes
checking for gai_strerror... yes
checking whether AI_ADDRCONFIG is declared... yes
checking whether AI_ALL is declared... yes
checking whether AI_NUMERICSERV is declared... yes
checking whether AI_V4MAPPED is declared... yes
checking whether IPV6_V6ONLY is declared... yes
checking for sendfile in sys/sendfile.h... yes
checking for sendfile in sys/socket.h... no
checking for gethostent... yes
checking for accept4... yes
configure: creating ./config.status
以下是来自config.log
的更多信息。首先是Output Variables
CFLAGS='-D_GNU_SOURCE -Wl,--hash-size=31 -Wl,--reduce-memory-overheads'
EXTRA_CPPFLAGS='-D_GNU_SOURCE'
这里有关于PEERCRED
configure:4301: checking for SO_PEERCRED and struct ucred in sys/socket.h
configure:4329: gcc -c -Wl,--hash-size=31 -Wl,--reduce-memory-overheads conftest.c >&5
conftest.c:39: error: storage size of 'u' isn't known
configure:4335: $? = 1
configure: failed program was:
| /* confdefs.h. */
| #define PACKAGE_NAME "Haskell network package"
| #define PACKAGE_TARNAME "network"
| #define PACKAGE_VERSION "2.3.0.14"
| #define PACKAGE_STRING "Haskell network package 2.3.0.14"
| #define PACKAGE_BUGREPORT "libraries@haskell.org"
| #define STDC_HEADERS 1
| #define HAVE_SYS_TYPES_H 1
| #define HAVE_SYS_STAT_H 1
| #define HAVE_STDLIB_H 1
| #define HAVE_STRING_H 1
| #define HAVE_MEMORY_H 1
| #define HAVE_STRINGS_H 1
| #define HAVE_INTTYPES_H 1
| #define HAVE_STDINT_H 1
| #define HAVE_UNISTD_H 1
| #define HAVE_FCNTL_H 1
| #define HAVE_LIMITS_H 1
| #define HAVE_STDLIB_H 1
| #define HAVE_SYS_TYPES_H 1
| #define HAVE_UNISTD_H 1
| #define HAVE_ARPA_INET_H 1
| #define HAVE_NETDB_H 1
| #define HAVE_NETINET_IN_H 1
| #define HAVE_NETINET_TCP_H 1
| #define HAVE_SYS_SOCKET_H 1
| #define HAVE_SYS_UIO_H 1
| #define HAVE_SYS_UN_H 1
| #define HAVE_READLINK 1
| #define HAVE_SYMLINK 1
| #define HAVE_STRUCT_MSGHDR_MSG_CONTROL 1
| #define HAVE_IN_ADDR_T 1
| /* end confdefs.h. */
| #include <sys/types.h>
| #include <sys/socket.h>
| #ifndef SO_PEERCRED
| # error no SO_PEERCRED
| #endif
| struct ucred u;
| int
| main ()
| {
|
| ;
| return 0;
| }
configure:4378: gcc -c -D_GNU_SOURCE -Wl,--hash-size=31 -Wl,--reduce-memory-overheads conftest.c >&5
configure:4384: $? = 0
configure:4414: result: yes
谢谢!,
兰吉特。