Andreas,
I am using FFI to make calls into the Gnu Scientific Library and am having problems that I do not understand. They provide "types" for various algorithms/functions/etc. which appear to be global structs. Suppose I want to use Haar wavelets; then I have interest in what I believe is a struct exported as gls_wavelet_haar.
My simple-minded understanding of such things is that "the name is address" and that dlsym()/GetProcAddress() should provide a void pointer to the correct place in memory. My attempts at doing that have ended badly. If I instead export a function of my own (from a library that links to GSL), something like
gls_wavelet_type* WaveletHaar()
{
return gsl_wavelet_haar;
}
and call it something like
waveletTypeHaar
< cdecl: GslWaveletType* WaveletHaar()>
then all is well. If I use
GslWaveletType fromHandle:
with an address from dlsym(), ugliness (segment fault) follows. Am I missing something really fundamental, or should #fromHandle: be able to do the job?
Bill
_______________________________________________
Pharo-project mailing list
[hidden email]
http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project