访问冲突错误尝试在Windows 10上运行简单的Yesod程序时

时间:2018-01-31 06:59:05

标签: haskell yesod haskell-stack

我试图通过堆栈工具在带有GHC版本8.2.2的Windows 10机器上运行一些基本的Haskell代码片段。我收到以下访问冲突错误:

e:\reset\as>stack runghc a.hs
stack runghc a.hs
Access violation in generated code when executing data at ffffffffac0039e0

" a.hs"的内容是:

{-# LANGUAGE OverloadedStrings     #-}
{-# LANGUAGE QuasiQuotes     #-}
{-# LANGUAGE TemplateHaskell     #-}
{-# LANGUAGE TypeFamilies     #-}

import Yesod

data HelloWorld = HelloWorld

mkYesod "HelloWorld" [parseRoutes|
/ HomeR GET
|]

instance Yesod HelloWorld

getHomeR :: Handler Html
getHomeR = defaultLayout [whamlet|Hello World!|]

main :: IO()
main = warp 3000 HelloWorld

我能够得到一些结果回到我的google-fu,但我不认为这个版本的ghci有一个合适的解决方案:

临时解决方案:Haskell-Stack: Access violation error during build

违反GHC 8.0.2:https://github.com/hedgehogqa/haskell-hedgehog/issues/111

在编译为dll时工作:Access violation in GHCI

是否有解释为什么会出现此错误,以及如何避免错误?

编辑:@epsilonhable询问编译是否有效;我试过了,它编译并运行没有任何问题。

e:\dir\reset\as>stack ghc a.hs
stack ghc a.hs
[1 of 1] Compiling Main             ( a.hs, a.o )
Linking a.exe ...


e:\HiHenry\reset\as>
e:\HiHenry\reset\as>a.exe
a.exe
01/Feb/2018:15:59:07 +0530 [Info#yesod-core] Application launched @(yesod-core-1.4.37.3-JVciWQSLH8J1mylGVdkmic:Yesod.Core.Dispatch .\Yesod\Core\Dispatch.hs:166:11)
127.0.0.1 - - [01/Feb/2018:15:59:50 +0530] "GET / HTTP/1.1" 200 82 "" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/63.0.3239.132 Safari/537.36"
127.0.0.1 - - [01/Feb/2018:15:59:50 +0530] "GET /favicon.ico HTTP/1.1" 404 118 "http://127.0.0.1:3001/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/63.0.3239.132 Safari/537.36"

通过解释器(stack runghc a.hs)运行它仍会导致访问冲突。

0 个答案:

没有答案