2011-03-13 57 views
8

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

順便說一句,我在這個過程中遇到了內存的兩倍,但我想這並不重要。

+1

我正在學習英語,對不起,我不能很好地使用它。 – SongPengpeng 2011-03-13 15:55:44

回答

9

麻煩來自於事實,

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