- Check File Paths: Ensure that the files ice.mexa64, iceproto.m, and icethunk.so are in the current working directory or provide the full path to these files when calling loadlibrary.
- Verify Function Signatures: Make sure that the iceproto.m file correctly defines the function signatures expected by the ice library. This file should contain the necessary prototype information for MATLAB to interface with the library.
- Correct Usage of loadlibrary: The loadlibrary function typically requires the name of the shared library and the prototype file. Ensure your command is structured correctly
- Check MATLAB Version Compatibility: Ensure that the MATLAB version you are using is compatible with the compiled MEX file. Sometimes, MEX files need to be compiled with specific MATLAB versions to ensure compatibility.
- Library Dependencies: Check if the ice library has any dependencies that are not met. You can use tools like ldd on the ice.mexa64 file to check for missing dependencies
- Recompile the MEX File: If the above steps don't resolve the issue, consider recompiling the MEX file. Make sure to use the correct compiler settings and MATLAB's mex function
- Check for Errors in Prototype File: Double-check the iceproto.m file for any syntax errors or incorrect function declarations that might prevent loadlibrary from executing properly.
load mex library error on Linux
1 view (last 30 days)
Show older comments
Hi,
I getting this error while trying to load a mex library on Ubuntu 20.04
>> loadlibrary('ice', @iceproto)
Error using message/getString
In 'MATLAB:loadlibrary:ErrorRunningFromCommandLine', parameter {0} must be a real scalar.
Error in loadlibrary
I have build a mex, proto and thunk files
ice.mexa64 iceproto.m icethunk.so
Cheers,
Jose
0 Comments
Answers (1)
Hornett
on 16 Aug 2024
Hi Jose,
The error you're encountering suggests that there might be an issue with how the loadlibrary function is being called or with the files involved. Here are some steps to help troubleshoot and resolve the issue:
0 Comments
See Also
Categories
Find more on MATLAB Compiler in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!