Why do I receive errors when I attempt to explicitly load generated shared libraries created from the MATLAB C/C++ Math Libraries on Linux?
8 次查看(过去 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!