Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Qt Creator and other tools
  4. can't find dll when debug/run in QtCreator

can't find dll when debug/run in QtCreator

Scheduled Pinned Locked Moved Solved Qt Creator and other tools
8 Posts 2 Posters 3.5k Views
  • 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.
  • J Offline
    J Offline
    jronald
    wrote on 16 Jan 2019, 17:51 last edited by jronald
    #1

    both methods don't work

    • projects -> Build & Run -> Run -> Run Environment -> append dll dir paths to variable "Path"
    • add dll dir paths to system environment "Path"

    env

    • os: win10
    • kit: MSVC2017
    • Qt: 5.12.0
    • QtCreator: 4.8.0

    BTW, if copy the dll to the dir where the executable is, it works.

    1 Reply Last reply
    0
    • J Offline
      J Offline
      jronald
      wrote on 17 Jan 2019, 04:42 last edited by
      #2

      solved
      The first method works, my mistake to not include enough path, QtCreator ignores all os environment variable "Path".

      BTW, it seems that dll can be specified in .pro file:
      https://wiki.qt.io/How_to_link_to_a_dll

      A 1 Reply Last reply 17 Jan 2019, 04:55
      0
      • J jronald
        17 Jan 2019, 04:42

        solved
        The first method works, my mistake to not include enough path, QtCreator ignores all os environment variable "Path".

        BTW, it seems that dll can be specified in .pro file:
        https://wiki.qt.io/How_to_link_to_a_dll

        A Offline
        A Offline
        aha_1980
        Lifetime Qt Champion
        wrote on 17 Jan 2019, 04:55 last edited by aha_1980
        #3

        @jronald

        QtCreator ignores all os environment variable "Path".

        It does not - I use it this way (I have a directory c:\dlls). But you have to restart all programs after such a change in order to take effect.

        Qt has to stay free or it will die.

        J 1 Reply Last reply 17 Jan 2019, 06:22
        0
        • A aha_1980
          17 Jan 2019, 04:55

          @jronald

          QtCreator ignores all os environment variable "Path".

          It does not - I use it this way (I have a directory c:\dlls). But you have to restart all programs after such a change in order to take effect.

          J Offline
          J Offline
          jronald
          wrote on 17 Jan 2019, 06:22 last edited by jronald
          #4

          @aha_1980 said in can't find dll when debug/run in QtCreator:

          @jronald

          QtCreator ignores all os environment variable "Path".

          It does not - I use it this way (I have a directory c:\dlls). But you have to restart all programs after such a change in order to take effect.

          I created a new project, projects -> Build & Run -> Run -> Run Environment -> Path includes all the paths in os env var Path, but for my old project is migrated from *nix os, and change os env var Path doesn't take effects. It seesm that QtCreator only find dlls in projects -> Build & Run -> Run -> Run Environment -> Path

          A 1 Reply Last reply 17 Jan 2019, 06:23
          1
          • J jronald
            17 Jan 2019, 06:22

            @aha_1980 said in can't find dll when debug/run in QtCreator:

            @jronald

            QtCreator ignores all os environment variable "Path".

            It does not - I use it this way (I have a directory c:\dlls). But you have to restart all programs after such a change in order to take effect.

            I created a new project, projects -> Build & Run -> Run -> Run Environment -> Path includes all the paths in os env var Path, but for my old project is migrated from *nix os, and change os env var Path doesn't take effects. It seesm that QtCreator only find dlls in projects -> Build & Run -> Run -> Run Environment -> Path

            A Offline
            A Offline
            aha_1980
            Lifetime Qt Champion
            wrote on 17 Jan 2019, 06:23 last edited by
            #5

            @jronald Well, if you change the PATH there, the system PATH is overwritten. But that is to expect, isn't it?

            Qt has to stay free or it will die.

            J 1 Reply Last reply 17 Jan 2019, 06:25
            1
            • A aha_1980
              17 Jan 2019, 06:23

              @jronald Well, if you change the PATH there, the system PATH is overwritten. But that is to expect, isn't it?

              J Offline
              J Offline
              jronald
              wrote on 17 Jan 2019, 06:25 last edited by
              #6

              @aha_1980 that's ok, it means when the project has been created, changing os env var Path will not take effect any more.

              A 1 Reply Last reply 17 Jan 2019, 06:57
              0
              • J jronald
                17 Jan 2019, 06:25

                @aha_1980 that's ok, it means when the project has been created, changing os env var Path will not take effect any more.

                A Offline
                A Offline
                aha_1980
                Lifetime Qt Champion
                wrote on 17 Jan 2019, 06:57 last edited by aha_1980
                #7

                @jronald

                No. Once you changed the PATH for a project in Creator, the systems PATH no longer applies to this project, i.e. any change to the systems PATH have no effect for that project.

                Qt has to stay free or it will die.

                J 1 Reply Last reply 17 Jan 2019, 07:30
                2
                • A aha_1980
                  17 Jan 2019, 06:57

                  @jronald

                  No. Once you changed the PATH for a project in Creator, the systems PATH no longer applies to this project, i.e. any change to the systems PATH have no effect for that project.

                  J Offline
                  J Offline
                  jronald
                  wrote on 17 Jan 2019, 07:30 last edited by
                  #8

                  @aha_1980 said in can't find dll when debug/run in QtCreator:

                  @jronald

                  No. Once you changed the PATH for a project in Creator, the systems PATH no longer applies to this project, i.e. any change to the systems PATH have no effect for that project.

                  ok, sophisticated.

                  1 Reply Last reply
                  0

                  3/8

                  17 Jan 2019, 04:55

                  topic:navigator.unread, 5
                  • Login

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