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

Thomas Schilling nominolo at googlemail.com
Thu Sep 8 21:37:59 CEST 2011


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
list.

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-0.2.0.0/libHSghc-prim-0.2.0.0-ghc6.12.3.so:
> 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.



More information about the Haskell-Cafe mailing list