MATLAB exe calling in qt cpp
-
I am trying to call MATLAB exe in qt cpp using QProcess, when i am trying to call it is showing could not find matlab runtime, but matlab runtime is present in my system and also i have added in the system envirormental variables , if i click on matlab exe manually it is working but from qt it is showing error can anyone guide me how to resolve this issue thanks in advance...
-
I am trying to call MATLAB exe in qt cpp using QProcess, when i am trying to call it is showing could not find matlab runtime, but matlab runtime is present in my system and also i have added in the system envirormental variables , if i click on matlab exe manually it is working but from qt it is showing error can anyone guide me how to resolve this issue thanks in advance...
@harsha123 Try to set process environment using https://doc.qt.io/qt-5/qprocess.html#setProcessEnvironment
-
@harsha123
If that literal string for the path you put into the environment is supposed to make it work (I don't know that), you need to correct it for a C++ literal string.... -
@harsha123 Also, please post code as text, not pictures.
One hint regarding @JonB post: do you know the meaning of \ in a C++ string? -
ha \ is path seperator in cpp, i used all types of slashes but nothing worked it is not able to link the path.
@harsha123 said in MATLAB exe calling in qt cpp:
ha \ is path seperator in cpp
No, its not. Path separator is OS dependant, has nothing to do with C++. \ is escape character in C++ and most other programming languages. If you want to use it as path separator in a string you have to write it like:
"c:\\something\\...
Please read about \ in C++.
Also, why do you set that path as TMPDIR env variable?! You need to find out what env variables you have to set for Matlab...