我已经安装了网络包。当我尝试重新安装它(例如,与cabal-dev一起使用)时,它将无法编译。如果我cabal unpack network
然后尝试构建它,我会得到下面的输出。我猜这是因为我升级了Ubuntu依赖项。我升级到Ubuntu 11.04,希望它会有所帮助;它没有。还安装了libghc6-network-dev,以防止连接正确;它没有。我在ghc-7.0.2上,也尝试了ghc-7.0.3。目前正在尝试从源代码安装最新的haskell平台...任何帮助表示感谢 - 这完全杀死了我的haskell黑客攻击!
Socket.hsc: In function ‘main’: Socket.hsc:1033:5: error: invalid application of ‘sizeof’ to incomplete type ‘struct ucred’ Socket.hsc:1033:5: error: invalid application of ‘sizeof’ to incomplete type ‘struct ucred’ Socket.hsc:1033:5: error: invalid application of ‘sizeof’ to incomplete type ‘struct ucred’ Socket.hsc:1039:5: error: invalid use of undefined type ‘struct ucred’ Socket.hsc:1040:5: error: invalid use of undefined type ‘struct ucred’ Socket.hsc:1041:5: error: invalid use of undefined type ‘struct ucred’ compiling dist/build/Network/Socket_hsc_make.c failed (exit code 1)
命令是:
/usr/bin/gcc -c dist/build/Network/Socket_hsc_make.c -o dist/build/Network/Socket_hsc_make.o -fno-stack-protector -fno-stack-protector -D__GLASGOW_HASKELL__=700 -Dlinux_BUILD_OS -Dlinux_HOST_OS -Dx86_64_BUILD_ARCH -Dx86_64_HOST_ARCH -Iinclude -I/usr/local/lib/ghc-7.0.2/unix-2.4.2.0/include -Idist/build/autogen -include dist/build/autogen/cabal_macros.h -Idist/build/autogen -include dist/build/autogen/cabal_macros.h -Idist/build/autogen -include dist/build/autogen/cabal_macros.h -Idist/build/autogen -include dist/build/autogen/cabal_macros.h -I/usr/local/lib/ghc-7.0.2/bytestring-0.9.1.10/include -Idist/build/autogen -include dist/build/autogen/cabal_macros.h -I/usr/local/lib/ghc-7.0.2/base-4.3.1.0/include -Idist/build/autogen -include dist/build/autogen/cabal_macros.h -Idist/build/autogen -include dist/build/autogen/cabal_macros.h -Idist/build/autogen -include dist/build/autogen/cabal_macros.h -I/usr/local/lib/ghc-7.0.2/include -Idist/build/autogen -include dist/build/autogen/cabal_macros.h -I/usr/local/lib/ghc-7.0.2/include -Idist/build/autogen -include dist/build/autogen/cabal_macros.h -I/usr/local/lib/ghc-7.0.2/include/
这是我的gcc版本:
/usr/bin/gcc --version gcc (Ubuntu/Linaro 4.5.2-8ubuntu4) 4.5.2
答案 0 :(得分:1)
我升级到ghc 7.0.3然后从源代码安装了7.0.3 haskell平台,现在一切正常。不是我理解为什么:)
答案 1 :(得分:1)
如果我没记错,旧版本的cabal-install存在问题。尝试安装最新版本
cabal install cabal-install-0.10.2