[gambit-list] Dynamic loading
campbell at autodrip.bloodandcoffee.net
campbell at autodrip.bloodandcoffee.net
Mon Oct 25 15:54:36 EDT 2004
On Sun, 24 Oct 2004, Marc Feeley wrote:
> The documentation is out of sync. Now you have to explicitly add the ".oN"
> extension of the generated shared library in the name of the C file.
> That is you should do this:
>
> % gsc -flat -o foo.o1.c m2 m3
> % gcc -shared -fPIC -D___DYNAMIC m1.c m2.c m3.c foo.o1.c -o foo.o1 -I/usr/local/Gambit-C/include
>
> This is necessary to allow multiple versions of a module to be loaded
> at the same time on some systems.
Perhaps I'm wrong in thinking that nothing need be changed to do this
on OS X (except changing -shared to -dynamic), but I get a slightly
different error with the suggested fix:
% gsc -flat -o foo.o1.c foo
% gcc -dynamic -fPIC -D___DYNAMIC foo.c foo.o1.c -o foo.o1 -lgambc -I/usr/local/Gambit-C/include
ld: Undefined symbols:
_main
More information about the Gambit-list
mailing list