William C. Halliburton wrote on Wed, Apr 02, 2003 at 01:45:10PM -0500:
>
> I do not think the library is using any exceptions. It seems to be working
> but I have yet to glue much of it into my lisp system. The library is
> the tulip
> opengl graph drawing library.
>
> It it possible to initialize the C++ library from lisp if necessary?
Well, not in any documented way.
At my employer we found that virtual functions and initializes are run
fine (on Linux) when loading the library.
We found we had to prime the exception mechanism. The deliberately
throw an exception from useless empty non-resource-allocating code
directly after loading the library. If we don't then exceptions in
real code would do any kind of random stuff, including plain
errorormessageless longjumps back into the Lisp at random places.
That was fun, especially since there is no single united debugger
which would allow you to track both kind of code.
We also found that there is a huge problem around symbols that are in
libraries that CMUCL has already linked against, namely the C library,
but where only parts of these symbols are exported from the running
binary. Code dynamically loaded later would use these symbols from
the original copy of the C library, but a second copy of the C library
is pulled in and symbols not exported from the binary would be linked
there. If there are any functions in the C library whose
functionality depends on other symbols and you manipulate them from
your loaded code and you manipulate the wrong copy of the C library
then you lose. This is not C++ specific, though.
We are giving out combat badges to people who resolve issues like that :-)
Cheers
Martin