
On Thu, 2011-08-18 at 20:32 -0700, David Banas wrote:
Hi all,
Does this trigger recollection in anyone:
dbanas@dbanas-eeepc:~/prj/haskell/AMIParse/trunk$ make ghc -dynamic -o ami_test -L. -lami ami_test.o ./libami.so: undefined reference to `__stginit_haskell98_MarshalArray_' ./libami.so: undefined reference to `__stginit_haskell98_MarshalError_' collect2: ld returned 1 exit status make: *** [ami_test] Error 1 dbanas@dbanas-eeepc:~/prj/haskell/AMIParse/trunk$
? Know what I need to do?
Thanks, -db
So, I was able to make my link errors go away, by adding `-shared' to my
command line:
dbanas@dbanas-eeepc:~/prj/haskell/AMIParse/trunk$ make
ghc -no-hs-main -shared -dynamic -o ami_test -L. -lami ami_test.o
However, when I try to execute the resultant program, I get a
segmentation fault:
dbanas@dbanas-eeepc:~/prj/haskell/AMIParse/trunk$ ./ami_test test.ami
Segmentation fault
Tracing this shows that the `main' pointer of the program appears to be
NULL:
dbanas@dbanas-eeepc:~/prj/haskell/AMIParse/trunk$ gdb --args ./ami_test
test.ami
GNU gdb (GDB) 7.1-ubuntu
Copyright (C) 2010 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later
http://gnu.org/licenses/gpl.html
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law. Type "show
copying"
and "show warranty" for details.
This GDB was configured as "i486-linux-gnu".
For bug reporting instructions, please see:
http://www.gnu.org/software/gdb/bugs/...
Reading symbols
from /home/dbanas/prj/haskell/AMIParse/trunk/ami_test...done.
(gdb) l
2 #include