Shared libs on OS X

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

Shared libs on OS X

Per Persson
Hi,
I trying to resolve the lingering issues with shared and dynamic
loading on OS X. Right now I'm just using brute force to get something
to link...

Anyway, almost all of the problems concerns global symbols, almost all
of which are due to static variables in template functions. The
workaround is to promote the variable to a private member of the class.

I'm currently wrestling with the final change needed to get liboctave
working (as a shared lib) but I'm lost in the C++ jungle. How could I
get a private 'static  MDiagArray2<T> foo' instance for each of the
MDiagArray2<T> instantiations? I'm not asking that this code should be
part of octave (yet;-)), but I sure would like to get it running to
have something to work from.

Anyone?

/Per

Code in question (MDiagArray2.cc):
------
template <class T>
MDiagArray2<T>&
operator -= (MDiagArray2<T>& a, const MDiagArray2<T>& b)
{
...
   if (r != b_nr || c != b_nc)
     {
       gripe_nonconformant ("operator -=", r, c, b_nr, b_nc);
       // static MDiagArray2<T> foo;     /* Need to replace with private
member of class */
       return foo;
     }
...
   return a;
}



------------
Per Persson
Blekinge Institute of Technology
Dept. of Signal Processing and Telecommunications

www:   http://www.its.bth.se/staff/pee
e-mail: [hidden email]