Matlab Compiler - Runtime error in Qt Creator while initializing the MATLAB Runtime: shared object not open
Show older comments
I'm trying to include a Matlab program into Qt Creator on Ubuntu by using the Matlab Compiler. Therefore, I use a simple test program. In terminal everything works fine when I export LD_LIBRARY_PATH like this:
export LD_LIBRARY_PATH=/home/robin/Matlab_Runtime/v93/runtime/glnxa64:/home/robin/Matlab_Runtime/v93/bin/glnxa64:/home/robin/Matlab_Runtime/v93/sys/os/glnxa64:
and then run the program. Building the project in Qt Creator works fine, too, but on runtime I'm getting:
An Error has occurred while trying to initialize the MATLAB Runtime.
The error is: Fatal error loading library /home/robin/Matlab_Runtime/v93/bin/glnxa64/libmat.so Error: /home/robin/Matlab_Runtime/v93/bin/glnxa64/libmat.so: shared object not open
An Error has occurred while trying to initialize the MATLAB Runtime.
The error is: Fatal error loading library /home/robin/Matlab_Runtime/v93/bin/glnxa64/libmwmclbase.so Error: /home/robin/Matlab_Runtime/v93/bin/glnxa64/libmwmclbase.so: shared object not open
could not initialize the application properly
My LD_LIBRARY_PATH is:
/home/robin/Qt/5.9.1/gcc_64/lib:/home/robin/projects_opencv/Matlab_compiler_test/../../Matlab_Runtime/v93/runtime/glnxa64/:/home/robin/Matlab_Runtime/v93/runtime/glnxa64:/home/robin/Matlab_Runtime/v93/bin/glnxa64:/home/robin/Matlab_Runtime/v93/sys/os/glnxa64:/home/robin/Matlab_Runtime/v93/sys/opengl/lib/glnxa64:/home/robin/Matlab_Runtime/v93/extern/include
Relevant lines in my .pro file:
INCLUDEPATH += /home/robin/Matlab_Runtime/v93/extern/include
LIBS += -L$$PWD/../../Matlab_Runtime/v93/runtime/glnxa64/ -lmwmclmcrrt
INCLUDEPATH += $$PWD/../../Matlab_Runtime/v93/runtime/glnxa64
DEPENDPATH += $$PWD/../../Matlab_Runtime/v93/runtime/glnxa64
LIBS += -L$$PWD/../../Matlab_Runtime/v93/bin/glnxa64/ -lmat -lmwmclbase
INCLUDEPATH += $$PWD/../../Matlab_Runtime/v93/bin/glnxa64
DEPENDPATH += $$PWD/../../Matlab_Runtime/v93/bin/glnxa64
I'm grateful for any kind of help on this. Thank you very much!
2 Comments
Robin Szymanski
on 24 Jan 2018
Hazik Ahmad
on 26 Apr 2018
Hi Robin, did you have any luck with this?
Answers (1)
I have no problem with QT4.8.
Categories
Find more on Plot Settings 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!