无法安装网络包
我已经安装了网络包。当我尝试重新安装它(例如,与 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
I have the network package already installed. When I try to reinstall it (for use with cabal-dev, for example), it won't compile. If I cabal unpack network
and then try to build that, I get the output below. I am guessing that this broke because I upgraded an Ubuntu dependency. I upgraded to Ubuntu 11.04 in hopes that it would help; it didn't. Also installed libghc6-network-dev in case that would make things link correctly; it didn't. I am on ghc-7.0.2, and just tried ghc-7.0.3 also. Currently trying installing the latest haskell platform from source... Any help appreciated- this is completely killing my haskell hacking!
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)
command was:
/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/
Here is my gcc version:
/usr/bin/gcc --version gcc (Ubuntu/Linaro 4.5.2-8ubuntu4) 4.5.2
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
我升级到 ghc 7.0.3,然后从源代码安装了 7.0.3 haskell 平台,现在一切正常。我不明白为什么:)
I upgraded to ghc 7.0.3 and then installed the 7.0.3 haskell platform from source, and now everything is working. Not that I understand why :)
如果我没记错的话,旧版本的 cabal-install 存在问题。尝试安装最新版本
If I remember correctly there was a problem with older versions of cabal-install. Try to install the latest version