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. Linking an exe against static libraries using shadowbuild directories...
QtWS25 Last Chance

Linking an exe against static libraries using shadowbuild directories...

Scheduled Pinned Locked Moved Unsolved Qt Creator and other tools
qmakeshadowbuildliblink
4 Posts 2 Posters 1.7k 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.
  • zyendZ Offline
    zyendZ Offline
    zyend
    wrote on last edited by
    #1

    Hi,

    I plan to use QtCreator for my crossplatform Qt applications after spending years using custom makefiles...
    Now I'm developping for both windows, linux-x86 and raspberrypi2

    Using QTCreator, I let the shawbuild option on as it's strongly recommended.

    e.g. the shadowbuild are generated in:

    d:/dev/cpp/build/build-mylib-Desktop_Qt_5_4_1_MSVC2013_32bit-Debug
    d:/dev/cpp/build/build-myexe-Desktop_Qt_5_4_1_MSVC2013_32bit-Debug
    

    However, myexe is statically linked against mylib.

    But in the project of myexe, I need to specify the path to locate mylib.
    If the variable $$OUT_PWD does refect the build directory of myexe, I've no way to retrieve the destination dir of mylib.

    Well, there are many workarounds to solve this problem, but I'd like to find the proper way to fix it.
    I mean in a "qmake" style !

    Any suggestion is greatly welcome.

    Z.

    raven-worxR 1 Reply Last reply
    0
    • zyendZ zyend

      Hi,

      I plan to use QtCreator for my crossplatform Qt applications after spending years using custom makefiles...
      Now I'm developping for both windows, linux-x86 and raspberrypi2

      Using QTCreator, I let the shawbuild option on as it's strongly recommended.

      e.g. the shadowbuild are generated in:

      d:/dev/cpp/build/build-mylib-Desktop_Qt_5_4_1_MSVC2013_32bit-Debug
      d:/dev/cpp/build/build-myexe-Desktop_Qt_5_4_1_MSVC2013_32bit-Debug
      

      However, myexe is statically linked against mylib.

      But in the project of myexe, I need to specify the path to locate mylib.
      If the variable $$OUT_PWD does refect the build directory of myexe, I've no way to retrieve the destination dir of mylib.

      Well, there are many workarounds to solve this problem, but I'd like to find the proper way to fix it.
      I mean in a "qmake" style !

      Any suggestion is greatly welcome.

      Z.

      raven-worxR Offline
      raven-worxR Offline
      raven-worx
      Moderators
      wrote on last edited by raven-worx
      #2

      @zyend said:

      But in the project of myexe, I need to specify the path to locate mylib.

      you rather need to specify the path relative to your project file than to your exe in the output directory.

      --- SUPPORT REQUESTS VIA CHAT WILL BE IGNORED ---
      If you have a question please use the forum so others can benefit from the solution in the future

      1 Reply Last reply
      0
      • zyendZ Offline
        zyendZ Offline
        zyend
        wrote on last edited by
        #3

        Sorry, I don't understand what you mean.
        The library (mylib.lib) is located in its respective shadowbuild directory.

        But somewhere in myexe.pro, I expect having something like:

        win32:CONFIG(release, debug|release): PRE_TARGETDEPS += $$OUT_PWD/../**xxx**/libmylib.lib
        

        But currently, "xxx" is the shadowbuild directory and I can't guess its exact path.

        raven-worxR 1 Reply Last reply
        0
        • zyendZ zyend

          Sorry, I don't understand what you mean.
          The library (mylib.lib) is located in its respective shadowbuild directory.

          But somewhere in myexe.pro, I expect having something like:

          win32:CONFIG(release, debug|release): PRE_TARGETDEPS += $$OUT_PWD/../**xxx**/libmylib.lib
          

          But currently, "xxx" is the shadowbuild directory and I can't guess its exact path.

          raven-worxR Offline
          raven-worxR Offline
          raven-worx
          Moderators
          wrote on last edited by raven-worx
          #4

          @zyend
          ok my answer was regarding qmake only sry.
          For a qmake only solution you could define the target directory for the lib, and specify this path (relatively) in your myexe pro file.

          But IIRC QtCreator solely ignores the output dirs specified in the qmake pro-file and uses it's custom settings instead. See this, to link to an internal project in QtCreator.

          --- SUPPORT REQUESTS VIA CHAT WILL BE IGNORED ---
          If you have a question please use the forum so others can benefit from the solution in the future

          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