How do I compile with shared libraries for my MEX files on Linux?
Afficher commentaires plus anciens
I'm trying to compile a CPP script, "foo.cpp", that relies on a shared library, "libfoolibrary.so", into a MEX file on Linux. However, even though it compiles successfully, it fails at runtime, giving me the following error message:
>> mex -DLIN -DUNIX -DNDEBUG -D_USRDLL -O foo.cpp -output foo_mex -lfoolibrary -L./
Building LIN64 MEX function...
Building with 'g++'.
MEX completed successfully.
MEX function compilation completed successfully
>> foo_mex
Running the MEX function... Invalid MEX-file '/home/MATLAB/foo_mex.mexa64': libfoolibrary.so: cannot open shared object file: No such file or directory
This doesn't happen when I try to do this on Windows. Am I doing something wrong?
Réponse acceptée
Plus de réponses (0)
Catégories
En savoir plus sur MATLAB Compiler dans Centre d'aide et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!