{-# LANGUAGE OverloadedStrings #-}
module Main (main) where
import qualified SDL
import qualified Common as C
main :: IO ()
main = C.withSDL $ C.withWindow "Lesson 01" (640, 480) $
\w -> do
screen <- SDL.getWindowSurface w
-- pixelFormat <- SDL.surfaceFormat `applyToPointer` screen
-- color <- SDL.mapRGB pixelFormat 0xFF 0xFF 0xFF
SDL.surfaceFillRect screen Nothing (SDL.V4 maxBound maxBound maxBound maxBound)
SDL.updateWindowSurface w
SDL.delay 2000
SDL.freeSurface screen
This is my source code,and when I try to run it in GHCI,I got an error
Main.hs:6:1: error:
Could not find module ‘Common’
Use -v (or `:set -v` in ghci) to see a list of the files searched for.
|
6 | import qualified Common as C
so I attempted to use cabal to install this Common module,but got another error:
D:\CS\Haskell\test\haskell-stuff-master\sdl>cabal install Common
Resolving dependencies...
cabal.exe: Could not resolve dependencies:
[__0] unknown package: Common (user goal)
[__0] fail (backjumping, conflict set: Common)
After searching the rest of the dependency tree exhaustively, these were the
goals I've had most trouble fulfilling: Common
How do I install this module with cabal?