GHC 告诉我它有效,但它不会生成二进制文件。我不知道为什么
$ ls
total 8
-rw-r--r-- 1 drewgross staff 361B 9 Sep 01:21 MouseMove.hs
$ ghc MouseMove.hs
[1 of 1] Compiling MouseMove ( MouseMove.hs, MouseMove.o )
$ echo $?
0
$ ls
total 32
-rw-r--r-- 1 drewgross staff 926B 9 Sep 01:29 MouseMove.hi
-rw-r--r-- 1 drewgross staff 361B 9 Sep 01:21 MouseMove.hs
-rw-r--r-- 1 drewgross staff 5.7K 9 Sep 01:29 MouseMove.o
这是我的 MouseMove.hs 文件:
{-# LANGUAGE ForeignFunctionInterface #-}
module MouseMove where
import Foreign
import Foreign.C.Types
import Control.Applicative
foreign import ccall "/System/Library/Frameworks/CoreGraphics.framework/Versions/A/Headers/CGRemoteOperation.h CGWarpMouseCursorPosition"
c_warp :: CFloat -> CFloat -> IO CInt
main = print =<< (fromIntegral <$> c_warp 100 100)
我的 GHC 版本是
$ ghc --version
The Glorious Glasgow Haskell Compilation System, version 7.6.3
有任何想法吗?没有错误消息,我不知道该尝试什么。