Fwd: [Haskell-cafe] Undefined symbol error coming from shared, dynamic library.

capn.freako@gmail.com capn.freako at gmail.com
Fri Sep 9 17:12:42 CEST 2011


----- Forwarded message -----
From: "Thomas Schilling" <nominolo at googlemail.com>
Date: Thu, Sep 8, 2011 12:37 pm
Subject: [Haskell-cafe] Undefined symbol error coming from shared, dynamic library.
To: "David Banas" <dbanas at banasfamily.net>
Cc: <haskell-cafe at haskell.org>, <capn.freako at gmail.com>

stg_newByteArrayzh is defined in the runtime system.  Presumably you
need to link against the GHC runtime system.  If that doesn't help try
asking your question on the glasgow-haskell-users at haskell.org mailing

On 6 September 2011 16:52, David Banas <dbanas at banasfamily.net> wrote:
> Hi all,
> I'm trying to build a shared, dynamic library for use with a C program.
> I'm getting an `undefined symbol' error, when I try to run that C
> program,
> and was hoping that the last line in the output, below, might mean
> something to someone.
> I include the entire output of a `make rebuild' command, below, hoping
> that, maybe, I just have my command line options a little wrong.
> Thanks!
> -db
> dbanas at dbanas-eeepc:~/prj/haskell/AMIParse/trunk$ make rebuild
> make clean
> make[1]: Entering directory `/home/dbanas/prj/haskell/AMIParse/trunk'
> rm -f *.hi *.o *.out ami_test *.so
> make[1]: Leaving directory `/home/dbanas/prj/haskell/AMIParse/trunk'
> make all
> make[1]: Entering directory `/home/dbanas/prj/haskell/AMIParse/trunk'
> gcc -I/usr/lib/ghc-6.12.3/include/ -g -fPIC   -c -o ami_test.o
> ami_test.c
> gcc -rdynamic -o ami_test ami_test.o -ldl
> ghc -c ApplicativeParsec.hs -cpp -package parsec-3.1.1 -package dsp
> -dynamic -fPIC
> ghc -c AMIParse.hs -cpp -package parsec-3.1.1 -package dsp -dynamic
> -fPIC
> ghc -c ExmplUsrModel.hs -cpp -package parsec-3.1.1 -package dsp -dynamic
> -fPIC
> ghc -c AMIModel.hs -cpp -package parsec-3.1.1 -package dsp -dynamic
> -fPIC
> gcc -I/usr/lib/ghc-6.12.3/include/ -g -fPIC   -c -o ami_model.o
> ami_model.c
> rm -f libami.so
> ghc -o libami.so -shared -dynamic -package parsec-3.1.1 -package dsp
> AMIParse.o AMIModel.o ami_model.o AMIModel_stub.o ApplicativeParsec.o
> ExmplUsrModel.o
> make[1]: Leaving directory `/home/dbanas/prj/haskell/AMIParse/trunk'
> dbanas at dbanas-eeepc:~/prj/haskell/AMIParse/trunk$ ./ami_test test.ami
> /usr/lib/ghc-6.12.3/ghc-prim-
> undefined symbol: stg_newByteArrayzh
> _______________________________________________
> Haskell-Cafe mailing list
> Haskell-Cafe at haskell.org
> http://www.haskell.org/mailman/listinfo/haskell-cafe

Push the envelope. Watch it bend.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.haskell.org/pipermail/glasgow-haskell-users/attachments/20110909/7199072c/attachment.htm>

More information about the Glasgow-haskell-users mailing list