时出错,编译qtHaskell
问题描述:
QMAKE和之后从these指令的mingw32-做成功, 我执行runhaskell Setup.hs build
,我得到以下错误:时出错,编译qtHaskell
[651 of 662] Compiling Qtc.Core.Attributes (Qtc\Core\Attributes.hs, dist\build\Qtc\Core\Attributes.o)
Qtc\Core\Attributes.hs:584:13:
Could not deduce (Qstt a (QDialogSc b))
arising from a use of `slotReject''
from the context (Qstt a (QDialogSc b1))
bound by the instance declaration
at Qtc\Core\Attributes.hs:582:10-52
Possible fix:
add (Qstt a (QDialogSc b)) to the context of
the instance declaration
or add an instance declaration for (Qstt a (QDialogSc b))
In the expression: slotReject'
In an equation for `reject'': reject' = slotReject'
In the instance declaration for `QsaSlotReject a'
的Attributes.hs文件(行578 - 583 ):
class QsaSlotReject w where
slotReject', reject' :: (Qslot w (w ->()), (w ->()))
instance (Qstt a (QDialogSc b)) => QsaSlotReject (a) where
slotReject' = (Qslot "reject()", \_ ->())
reject' = slotReject'
环境:
- Windows 7的
- 哈斯克尔平台2011.2.0
- 的Qt SDK 4.7
顺便说一句,我在这个过程中遇到了内存的两倍,但我想这并不重要。
答
麻烦来自于事实,
data Qslot x f = Qslot String
所以有什么推断X和F可能是从形式Qslot“等等等等”给定的项目有点难度。自从qthaskell的最后一个版本去年秋天上涨以来,GHC使用的推理机制可能会发生微妙的变化。
在任何情况下,它似乎编译,一些好奇的警告,以及工作的例子,如果你有
instance (Qstt a (QDialogSc b)) => QsaSlotReject (a) where
slotReject' = (Qslot "reject()", \_ ->())
reject' = (Qslot "reject()", \_ ->())
这样更换
instance (Qstt a (QDialogSc b)) => QsaSlotReject (a) where
slotReject' = (Qslot "reject()", \_ ->())
reject' = slotReject'
GHC简化版,不得不怀疑相当尽可能多...
必须有东西,会使事情更加精确。我不知道eta是否减少了后来开始系统性地出现的警告与这条线的关系。
+0
谢谢。你救了我的一天... – 2011-12-28 18:12:35
我正在学习英语,对不起,我不能很好地使用它。 – SongPengpeng 2011-03-13 15:55:44