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.
  • jronaldJ Offline
    jronaldJ Offline
    jronald
    wrote on 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
    • jronaldJ Offline
      jronaldJ Offline
      jronald
      wrote on 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

      aha_1980A 1 Reply Last reply
      0
      • jronaldJ jronald

        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

        aha_1980A Offline
        aha_1980A Offline
        aha_1980
        Lifetime Qt Champion
        wrote on 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.

        jronaldJ 1 Reply Last reply
        0
        • aha_1980A aha_1980

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

          jronaldJ Offline
          jronaldJ Offline
          jronald
          wrote on 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

          aha_1980A 1 Reply Last reply
          1
          • jronaldJ jronald

            @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

            aha_1980A Offline
            aha_1980A Offline
            aha_1980
            Lifetime Qt Champion
            wrote on 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.

            jronaldJ 1 Reply Last reply
            1
            • aha_1980A aha_1980

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

              jronaldJ Offline
              jronaldJ Offline
              jronald
              wrote on 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.

              aha_1980A 1 Reply Last reply
              0
              • jronaldJ jronald

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

                aha_1980A Offline
                aha_1980A Offline
                aha_1980
                Lifetime Qt Champion
                wrote on 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.

                jronaldJ 1 Reply Last reply
                2
                • aha_1980A aha_1980

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

                  jronaldJ Offline
                  jronaldJ Offline
                  jronald
                  wrote on 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

                  • Login

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