English 中文(简体)
我如何使用用 Cabal 创建的对象文件?
原标题:how do I use an object file created with Cabal?
  • 时间:2012-05-24 19:58:45
  •  标签:
  • haskell
  • ghci

I have a source file that will only compile with Cabal. It s test code, and in the past (before I complicated my Haskell environment) I would run functions from within ghci. I know ghci can use object files to load code, but when I try to do so I get the following error. So what am I missing?

$ghci/ home/mlitchard/Boris_Test/dist/building/Boris_Test/Boris_Test-mp/Main.o.o 美元/家庭/mlitchard/Boris_Test-tmp/Main.o

GHCi, version 7.4.1: http://www.haskell.org/ghc/  :? for help
Loading package ghc-prim ... linking ... done.
Loading package integer-gmp ... linking ... done.
Loading package base ... linking ... done.
Loading object (static) /home/mlitchard/Boris_Test/dist/build/Boris_Test/Boris_Test-tmp/Main.o ... done
final link ... ghc: /home/mlitchard/Boris_Test/dist/build/Boris_Test/Boris_Test-tmp/Main.o: unknown symbol

monadzmcontrolzm0zi3zi1zi3_ControlziMonadziTransziControl_zdfMonadBaseControlIOIO_closure linking extra libraries/objects failed

最佳回答

当您手动指定对象文件时, GHIIi 无法辨别对象文件取决于什么, 它可以用 < code>.hs 文件做什么, 因为它可以访问此情况下的 < code > import... 线 。

因此,您需要手工添加所有相关依赖物的对象文件,在此情况下,在援引 GHCi 时添加 < code>- package monad-control , 添加 < code >- package- madad- control 。

问题回答

暂无回答




相关问题
Euler Problem in Haskell -- Can Someone Spot My Error

I m trying my hand at Euler Problem 4 in Haskell. It asks for that largest palindrome formed by multiplying two three-digit numbers. The problem was simple enough, and I thought my Haskell-fu was up ...

How does foldr work?

Can anybody explain how does foldr work? Take these examples: Prelude> foldr (-) 54 [10, 11] 53 Prelude> foldr (x y -> (x+y)/2) 54 [12, 4, 10, 6] 12.0 I am confused about these executions....

Efficient queue in Haskell

How can I efficiently implement a list data structure where I can have 2 views to the head and end of the list, that always point to a head a tail of a list without expensive calls to reverse. i.e: ...

Problem detecting cyclic numbers in Haskell

I am doing problem 61 at project Euler and came up with the following code (to test the case they give): p3 n = n*(n+1) `div` 2 p4 n = n*n p5 n = n*(3*n -1) `div` 2 p6 n = n*(2*n -1) p7 n = n*(5*n -3)...

Ways to get the middle of a list in Haskell?

I ve just started learning about Functional Programming, using Haskel. I m slowly getting through Erik Meijer s lectures on Channel 9 (I ve watched the first 4 so far) and in the 4th video Erik ...

haskell grouping problem

group :: Ord a => [(a, [b])] -> [(a, [b])] I want to look up all pairs that have the same fst, and merge them, by appending all the list of bs together where they have the same a and discarding ...

Closest equivalent to subprocess.communicate in Haskell

I want to do a popen() / python s subprocess.communicate from Haskell - start a program, give it stdin, and get its stdout/stderr. What s the most direct / Haskellish way to do this?

热门标签