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

    jsulmJ 1 Reply Last reply
    0
    • H harsha123

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

      jsulmJ Offline
      jsulmJ Offline
      jsulm
      Lifetime Qt Champion
      wrote on 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 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

        JonBJ jsulmJ 2 Replies Last reply
        0
        • H harsha123

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

          Getting error like this

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

          JonBJ Offline
          JonBJ Offline
          JonB
          wrote on 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

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

            Getting error like this

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

            jsulmJ Offline
            jsulmJ Offline
            jsulm
            Lifetime Qt Champion
            wrote on 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 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.

              jsulmJ 1 Reply Last reply
              0
              • H harsha123

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

                jsulmJ Offline
                jsulmJ Offline
                jsulm
                Lifetime Qt Champion
                wrote on last edited by jsulm
                #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 last edited by
                  #8

                  ok, i will try in that way .

                  1 Reply Last reply
                  0
                  • H Offline
                    H Offline
                    harsha123
                    wrote on 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

                    • Login

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