MATLAB exe calling in qt cpp
-
wrote on 8 Sept 2022, 10:47 last edited by
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
-
wrote on 8 Sept 2022, 11:17 last edited by
-
wrote on 8 Sept 2022, 11:30 last edited by
@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? -
wrote on 8 Sept 2022, 12:48 last edited by
ha \ is path seperator in cpp, i used all types of slashes but nothing worked it is not able to link the path.
-
ha \ is path seperator in cpp, i used all types of slashes but nothing worked it is not able to link the path.
Lifetime Qt Championwrote on 8 Sept 2022, 12:54 last edited by jsulm 9 Aug 2022, 12:56@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...
-
wrote on 8 Sept 2022, 13:02 last edited by
ok, i will try in that way .
-
wrote on 14 Sept 2022, 11:39 last edited by
Thank u for the support the problem is because of some internal admin permissions because of that qt was not able access the dll's.
1/9