Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. MATLAB exe calling in qt cpp
Forum Updated to NodeBB v4.3 + New Features

MATLAB exe calling in qt cpp

Scheduled Pinned Locked Moved Unsolved General and Desktop
9 Posts 3 Posters 510 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • H Offline
    H Offline
    harsha123
    wrote on 8 Sept 2022, 10:47 last edited by
    #1

    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...

    J 1 Reply Last reply 8 Sept 2022, 11:00
    0
    • H harsha123
      8 Sept 2022, 10:47

      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...

      J Offline
      J Offline
      jsulm
      Lifetime Qt Champion
      wrote on 8 Sept 2022, 11:00 last edited by
      #2

      @harsha123 Try to set process environment using https://doc.qt.io/qt-5/qprocess.html#setProcessEnvironment

      https://forum.qt.io/topic/113070/qt-code-of-conduct

      1 Reply Last reply
      1
      • H Offline
        H Offline
        harsha123
        wrote on 8 Sept 2022, 11:17 last edited by
        #3

        Tried in this way
        1fcf86be-a833-4390-af7f-008053fb2eb4-image.png

        Getting error like this

        155c9195-34da-4c2a-bcd5-f6ac11b2d9c5-image.png

        J J 2 Replies Last reply 8 Sept 2022, 11:30
        0
        • H harsha123
          8 Sept 2022, 11:17

          Tried in this way
          1fcf86be-a833-4390-af7f-008053fb2eb4-image.png

          Getting error like this

          155c9195-34da-4c2a-bcd5-f6ac11b2d9c5-image.png

          J Offline
          J Offline
          JonB
          wrote on 8 Sept 2022, 11:30 last edited by
          #4

          @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....

          1 Reply Last reply
          1
          • H harsha123
            8 Sept 2022, 11:17

            Tried in this way
            1fcf86be-a833-4390-af7f-008053fb2eb4-image.png

            Getting error like this

            155c9195-34da-4c2a-bcd5-f6ac11b2d9c5-image.png

            J Offline
            J Offline
            jsulm
            Lifetime Qt Champion
            wrote on 8 Sept 2022, 11:31 last edited by
            #5

            @harsha123 Also, please post code as text, not pictures.
            One hint regarding @JonB post: do you know the meaning of \ in a C++ string?

            https://forum.qt.io/topic/113070/qt-code-of-conduct

            1 Reply Last reply
            0
            • H Offline
              H Offline
              harsha123
              wrote on 8 Sept 2022, 12:48 last edited by
              #6

              ha \ is path seperator in cpp, i used all types of slashes but nothing worked it is not able to link the path.

              J 1 Reply Last reply 8 Sept 2022, 12:54
              0
              • H harsha123
                8 Sept 2022, 12:48

                ha \ is path seperator in cpp, i used all types of slashes but nothing worked it is not able to link the path.

                J Offline
                J Offline
                jsulm
                Lifetime Qt Champion
                wrote on 8 Sept 2022, 12:54 last edited by jsulm 9 Aug 2022, 12:56
                #7

                @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...

                https://forum.qt.io/topic/113070/qt-code-of-conduct

                1 Reply Last reply
                1
                • H Offline
                  H Offline
                  harsha123
                  wrote on 8 Sept 2022, 13:02 last edited by
                  #8

                  ok, i will try in that way .

                  1 Reply Last reply
                  0
                  • H Offline
                    H Offline
                    harsha123
                    wrote on 14 Sept 2022, 11:39 last edited by
                    #9

                    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 Reply Last reply
                    0

                    1/9

                    8 Sept 2022, 10:47

                    • Login

                    • Login or register to search.
                    1 out of 9
                    • First post
                      1/9
                      Last post
                    0
                    • Categories
                    • Recent
                    • Tags
                    • Popular
                    • Users
                    • Groups
                    • Search
                    • Get Qt Extensions
                    • Unsolved