Creating 'LD_LIBRARY_PATH' for MATLAB runtime conflicts with QT

22 views (last 30 days)
Hi,
I created 'LD_LIBRARY_PATH' environment variable, by adding an export statament in .bashrc, for my MATLAB exectuable file to run properly.
atinxx@xxx:~$ echo $LD_LIBRARY_PATH
/usr/local/MATLAB/MATLAB_Runtime/R2023a/runtime/glnxa64:/usr/local/MATLAB/MATLAB_Runtime/R2023a/bin/glnxa64:/usr/local/MATLAB/MATLAB_Runtime/R2023a/sys/os/glnxa64:/usr/local/MATLAB/MATLAB_Runtime/R2023a/extern/bin/glnxa64
However, this variable is causing some conflict with another pllication and giving following error -
QFactoryLoader::QFactoryLoader() checking directory path "/usr/bin/platforms" ...
qt.qpa.plugin: Could not find the Qt platform plugin "xcb" in ""
This application failed to start because no Qt platform plugin could be initialized. Reinstalling the application may fix this problem.
Although, this warning was given in MATLAB's documentation - 'Set MATLAB Runtime Path for Deployment', now I am tring to find a solution for this.
I am using Debian 10.
In a nutshell,
  1. I have an executable file
  2. Installed MATLAB Runtime for executing the file
  3. Created 'LD_LIBRARY_PATH' environment variable, which was not present earlier
  4. Now, it conflicts with another application giving an error
  5. Deleting 'LD_LIBRARY_PATH' environment variable, makes the other application work perfectly
  6. But now I cannot execute the MATLAB executable file!
It would be great if anyone can help!
  1 Comment
Atin
Atin on 22 Mar 2023
Is there any way to run it without MATLAB Runtime in order to avoid this conflict? I have MATLAB already installed on my linux machine

Sign in to comment.

Answers (1)

Vinayak Gupta
Vinayak Gupta on 6 Apr 2023
Hi Atin
It is currently not possible to run a standalone application within MATLAB as they are designed to be shared and run without the MATLAB installation.
It seems like you might be overwriting the 'LD_LIBRARY_PATH' variable instead of appending to it. Instead try appending to it using:
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/MATLAB/MATLAB_Runtime/R2023a/runtime/glnxa64
Even if it still conflicts with other application, you might need to write a small script with temporary sets the variable before execution of the MATLAB executable.

Categories

Find more on Introduction to Installation and Licensing in Help Center and File Exchange

Products


Release

R2023a

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!