ghc 7.4.1不生成stub.o文件 [英] ghc 7.4.1 not producing stub.o files

查看:125
本文介绍了ghc 7.4.1不生成stub.o文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在Ubuntu上运行Haskell平台的默认安装,当我运行这个例子时, http://www.haskell.org / haskellwiki / Calling_Haskell_from_C ghc -c -O Safe.hs不生成Safe_stub.o文件。我已经在一个朋友盒以及32位和64位的Ubuntu安装上单独安装了Ubuntu。

I'm running the default installation of Haskell platform on Ubuntu and when I run this example http://www.haskell.org/haskellwiki/Calling_Haskell_from_C "ghc -c -O Safe.hs" is not producing the Safe_stub.o file. I have checked this on a separate installation of Ubuntu on a friends box and on both 32 bit and 64 bit Ubuntu installs.

有人可以确认这是否特定于ghc- 7.4.1还是只安装Ubuntu?

Can somebody confirm if this is specific to ghc-7.4.1 or Ubuntu installs only?

谢谢!

Thanks!

推荐答案

这是一个ghc-7.4(事实上 ghc> = 7.2 )。这并不需要并生成 * _ stub.o (或 * _ stub.c )文件。但是,最终编译的命令行必须更改

It's a ghc-7.4 (ghc >= 7.2 actually) thing. That doesn't need and produce *_stub.o (or *_stub.c) files anymore. However, the command line for the final compilation has to change

$ ghc -no-hs-main -optc-O test.c Safe.o  -o test

您必须告诉GHC, main 不是一个haskell调用。

You have to tell GHC that the main is not a haskell call.

这篇关于ghc 7.4.1不生成stub.o文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆