简体   繁体   English

ghc 7.4.1不生成stub.o文件

[英]ghc 7.4.1 not producing stub.o files

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. 我在Ubuntu上运行默认的Haskell平台安装,当我运行这个例子时, http://www.haskell.org/haskellwiki/Calling_Haskell_from_C “ghc -c -O Safe.hs”没有生成Safe_stub.o文件。 I have checked this on a separate installation of Ubuntu on a friends box and on both 32 bit and 64 bit Ubuntu installs. 我已经在朋友盒上以及32位和64位Ubuntu安装上单独安装Ubuntu进行了检查。

Can somebody confirm if this is specific to ghc-7.4.1 or Ubuntu installs only? 有人可以确认这是否特定于ghc-7.4.1或仅安装Ubuntu?

Thanks! 谢谢!

It's a ghc-7.4 ( ghc >= 7.2 actually) thing. 这是一个ghc-7.4(实际上是ghc >= 7.2 )。 That doesn't need and produce *_stub.o (or *_stub.c ) files anymore. 这不再需要并生成*_stub.o (或*_stub.c )文件。 However, the command line for the final compilation has to change 但是,最终编译的命令行必须更改

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

You have to tell GHC that the main is not a haskell call. 你必须告诉GHC main不是一个haskell电话。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM