Skip to content

Instantly share code, notes, and snippets.

@SaitoWu
Created February 12, 2011 10:52
Show Gist options
  • Save SaitoWu/823692 to your computer and use it in GitHub Desktop.
Save SaitoWu/823692 to your computer and use it in GitHub Desktop.
build your own c-repl
#clone repl from github or download form http://neugierig.org/software/c-repl/
git clone https://github.com/martine/c-repl.git c-repl
#install dependencies
sudo apt-get install ghc6 gccxml libghc6-parsec-dev libghc6-mtl-dev \
libghc6-hunit-dev
sudo apt-get install gdb libexpat1-dev c2hs libreadline-dev
#install cabal
sudo apt-get install cabal-install
#use cabal to install hexpat hgdbmi readline
cabal update
#>update cabal
cabal install cabal-install
cabal install hexpat
cabal install hgdbmi
cabal install readline
#cd to your c-repl repo
cabal configure
#got an error
setup: At least the following dependencies are missing:
hexpat ==0.9
#find in c-repl folder a file named c-repl.cabal
change:
Build-Depends:
base, bytestring, containers, directory, filepath, HUnit, mtl, parsec,
process, readline, unix, hexpat == 0.9, hgdbmi == 0.1
to:
Build-Depends:
base, bytestring, containers, directory, filepath, HUnit, mtl, parsec,
process, readline, unix, hexpat >= 0.9, hgdbmi == 0.1
#reinstall
cabal configure
cabal install
#success
./c-repl
c-repl: a C read-eval-print loop.
enter '.h' at the prompt for help.
> int x = 2;
> printf("%d\n",x);
2
#alias it will be better
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment