Why do I receive errors when I attempt to explicitly load generated shared libraries created from the MATLAB C/C++ Math Libraries on Linux?
1 回表示 (過去 30 日間)
古いコメントを表示
Why do I receive errors when I attempt to explicitly load generated shared libraries created from the MATLAB C/C++ Math Libraries on Linux?
I have created a shared library using the MATLAB Compiler on Linux using MATLAB (for example, libhello.so). When I attempt to load this from standalone C-code using the DLOPEN function, I receive an error.
I use the following steps to compile the program:
1. I execute the following code:
mcc -t -W lib:libhello -T link:lib hello.m
gcc -o test main.c -ldl
2. I then receive the following error when executing the 'test':
$ ./test
libmwlapack: load error:
/usr/local/src/matlab-6.1/bin/glnx86/atlas_PIII.so:
undefined symbol: ieeeck_
libmwlapack: load error: /usr/local/src/matlab-6.1/bin/glnx86/lapack.so:
undefined symbol: xerbla_
採用された回答
MathWorks Support Team
2009 年 6 月 27 日
You are receiving this error because the loader on Linux is currently unable to resolve symbols that are required by an explicitly loaded dynamic link library.
As a work around, please call the functions in the shared library implicitly, as the following pseudocode indicates (do not use dlopen(..) to load the library at run time):
#include "hello.h"
void main()
{
mlfInitializeHello();
//Make call to mlfHello(..)
mlfTerminateHello();
}
This way, you are directly linking against libhello.so.
0 件のコメント
その他の回答 (0 件)
参考
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!