[Simulink, S-functions] Calling Lapack++ library from a library called by a S-function

Hello fellow Simulink users,

I am developing some C++ S-functions which call an external C++ library for physical computations. Library exports match the principal methods used by the runtime environment :

(excerpt from the library header file :)

__declspec( dllexport )
static MyPhisicalBlock* create( void ) ;

__declspec( dllexport )
void set_parameters( double* foo,
                              double* bar ) ;

__declspec( dllexport )
void outputs( const double* const in1,
                    double* out1,
                    double* out2r ) ;

__declspec( dllexport )
void derivatives( const double* const in1 ) ;

If this library is independant (from Lapack++), everything works fine. But this library must use some BLAS and LAPACK routines from the linear algebra package Lapack++. But if I include this dependency in my library, my model doesn't run any more : the compilation is ok (mex -v my_sfunction.cpp mylib.lib lapackpp.lib), but the mexw32 file can't be loaded, and Matlab hangs with the error : 

Error while obtaining sizes from MEX S-function 'my_sfunction' in 'MyModel/S-Function'. MATLAB error message:
Invalid MEX-file 'C:\SFCN_test\my_sfunction.mexw32': The specified module could not be found.

Do you have an idea about this ?
3/26/2009 2:58:02 PM
comp.soft-sys.matlab 211264 articles. 25 followers. lunamoonmoon (257) is leader. Post Follow

0 Replies

Similar Articles

[PageSpeed] 49