Uploaded image for project: 'Qt Creator'
  1. Qt Creator
  2. QTCREATORBUG-31018

Application don't know linked shared library's dll path

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: P3: Somewhat important P3: Somewhat important
    • None
    • Qt Creator 13.0.0
    • Windows

      This bug report is following the conversation under bug report 29662.

       
      Since the commits to fix the previously mentionned issue, path to linked shared library .dll is no longer added to the PATH variable (When "Add build library search path to PATH" checked).

      This has been revert to work as in QtCreator 12.0 in commit 725cf06, but I want to understand the problem.

      I investigate a bit why this change occures and here is what I discover :

      The library is no part of input.targetDetails in function :

      src/plugins/cmakeprojectmanager/fileapidataextractor.cpp

      QList<CMakeBuildTarget> generateBuildTargets(const QFuture<void> &cancelF
                           const FilePath &buildDirectory,
                           bool relativeLibs)
      

      I First get into this case with an already compiled shared library, so I just fix my problem by doing the copy of .dll at POST_BUILD into the exe output directory.

      But the problem occures also when the target compile the shared library itself. In this case, QtCreator should detect the path of the shared library binaries.

       

      project CMakeList.txt :

      # Create the project
      project(cmake-example)
      
      # Add subprojects
      add_subdirectory(mylib)
      add_subdirectory(myapp) 

      app CMakeList.txt :

      add_executable(myapp
          src/main.cpp
      )
      add_dependencies(myapp mylib)               # Add dependancy to mylib
      target_link_libraries(myapp PRIVATE mylib)  # Link mylib
      

      library CMakeList.txt :

      add_library(mylib SHARED)
      

      Do my CMake configuration missing an information to make QtCreator detect the shared library ?

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

            cadam Cristian Adam
            lucast Lucas Terrier
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:

                There are no open Gerrit changes