I was learning how to use this SDK from https://github.com/spaceships/garbled-circuits
When I finished downloading the dependencies and tried to compile one example, the error was like parse error on input '#' Here is the source code where the error came from:
import Prelude hiding (traverse)
#ifdef DEBUG
import Debug.Trace
#else
trace :: String -> a -> a
trace = flip const
traceM :: Monad m => String -> m ()
traceM _ = return ()
#endif
I guess it was because the C grammar like '#ifdef' was used in a Haskell file that caused this error, but I'd already used cabal install cipher-aes128 to download this SDK's dependencies (maybe).
#ifdef
needsCPP
extension which is enabled in this cabal file (github.com/spaceships/garbled-circuits/blob/master/…). I guess it should compile when you build this library using cabal before working on one of the examples.ghc --make Garbler.hs
. Thanks to your help, I installed all the packages in the build-depends of the library, but it still can't work and the error information is still likeparse error on input '#'
. Excuse of my ignorance, I have no experience in using Haskell.ghc --make Garbler.hs
again, but the result didn't change........:(ghc --make Garbler.hs
. Running all the lines in build.sh should create an executable in the current directory.