Qt Forum

    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Unsolved

    Unsolved pro-file: force link with static library

    General and Desktop
    2
    6
    513
    Loading More Posts
    • 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.
    • D
      debian last edited by

      Hello, I use Qt-5.11.1 and QWebSockets, for this I add QT += websockets to pro-file.
      I can build shared and static libQt5WebSockets, but how can I force link with static library in pro-file?
      Thank you excuse my bad english.

      raven-worx 1 Reply Last reply Reply Quote 0
      • raven-worx
        raven-worx Moderators @debian last edited by

        @debian said in pro-file: force link with static library:

        I can build shared and static libQt5WebSockets, but how can I force link with static library in pro-file?

        it depends which Qt kit you are using in the end. The linked lib decides if it's static or dynamic.
        You can't mix them anyway in a single Qt installation.

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

        D 1 Reply Last reply Reply Quote 1
        • D
          debian @raven-worx last edited by

          @raven-worx sorry, I not understand.
          If I have both, static and shared, libraries in same directory linker choose shared libraries, how can I force use static library in this case?

          raven-worx 1 Reply Last reply Reply Quote 0
          • raven-worx
            raven-worx Moderators @debian last edited by

            @debian said in pro-file: force link with static library:

            If I have both, static and shared, libraries in same directory linker choose shared libraries, how can I force use static library in this case?

            exactly. why do you have static and dynamic libs in the same folder in the first place?!

            --- 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 Reply Quote 1
            • D
              debian last edited by

              Why not?
              So I can't force use static library in pro-file and should story static and shared libraries in different directories?
              Thank you.

              raven-worx 1 Reply Last reply Reply Quote 0
              • raven-worx
                raven-worx Moderators @debian last edited by

                @debian said in pro-file: force link with static library:

                So I can't force use static library in pro-file and should story static and shared libraries in different directories?

                exactly, thats what i already said.
                Your Qt installation should either be compiled dynamic or static.

                the main reason is:
                QT += websockets adds linker commands for a specific lib name to the makefile for build.

                You renamed your static libs and copied them beside the dynamic ones?

                --- 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 Reply Quote 0
                • First post
                  Last post