[Haskell-cafe] parsec linking problem
naruto canada
narutocanada at gmail.com
Mon Jul 7 14:30:56 EDT 2008
hi
I've just managed to get ghc-6.8.3 installed and tried to run an
example from "http://en.wikibooks.org/wiki/Write_Yourself_a_Scheme_in_48_Hours/Parsing"
I run into linking error with parsec:
Here is the code:
module Main where
import System.Environment
import Text.ParserCombinators.Parsec hiding (spaces)
symbol :: Parser Char
symbol = oneOf "!#$%&|*+-/:<=>?@^_~"
main :: IO ()
main = do
-- args <- getArgs
-- putStrLn ("Hello, " ++ (args!!0) ++ " " ++ (args!!1) )
-- putStrLn ( show( read(args!!0) + read(args!!1) ) )
putStrLn ( "give me a name:" )
name <- getLine
putStrLn ( name )
ghc -o /tmp/a.out accu.hs
accu.o: In function `so8_info':
: undefined reference to
`parseczm2zi1zi0zi1_TextziParserCombinatorsziParsecziChar_oneOf_closure'
accu.o: In function `spP_info':
: undefined reference to
`__stginit_parseczm2zi1zi0zi1_TextziParserCombinatorsziParsec_'
accu.o: In function `so8_closure':
: undefined reference to
`parseczm2zi1zi0zi1_TextziParserCombinatorsziParsecziChar_oneOf_closure'
collect2: ld returned 1 exit status
Thanks
my installation steps (just in case you need to know):
WGET_UNPACK http://ftp.gnu.org/gnu/readline/readline-4.3.tar.gz
./configure --prefix=/usr
make clean ; make || INTERVENTION
find . -name libhistory.so*
find . -name libreadline.so*
cp shlib/libhistory.so.4.3 /lib
cp shlib/libreadline.so.4.3 /lib
ln -sfvn libhistory.so.4.3 /lib/libhistory.so.4
ln -sfvn libreadline.so.4.3 /lib/libreadline.so.4
WGET_UNPACK http://haskell.org/ghc/dist/6.8.2/ghc-6.8.2-i386-unknown-linux.tar.bz2
cd ghc-6.8.2
autoreconf
./configure --prefix=/usr
make install
echo 'main = putStrLn "hello"' > t.hs
ghc t.hs
./a.out | grep hello || INTERVENTION
rm -rf /build/ghc-6.8.2
WGET_UNPACK http://haskell.org/ghc/dist/6.8.3/ghc-6.8.3-src-extralibs.tar.bz2
WGET_UNPACK http://haskell.org/ghc/dist/6.8.3/ghc-6.8.3-src.tar.bz2
cd ghc-6.8.3
autoreconf
./configure --prefix=/usr
make clean ; make || INTERVENTION
make || INTERVENTION
make install
echo 'main = putStrLn "hello"' > t.hs
ghc t.hs
./a.out | grep hello || INTERVENTION
ghc --version | grep 6.8.3 || INTERVENTION
More information about the Haskell-Cafe
mailing list