Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Mobile and Embedded
  4. Static-linking of libraries to Qt application
Forum Update on Monday, May 27th 2025

Static-linking of libraries to Qt application

Scheduled Pinned Locked Moved Unsolved Mobile and Embedded
9 Posts 3 Posters 2.9k 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.
  • L Offline
    L Offline
    Lavanya
    wrote on last edited by Lavanya
    #1

    if we have a qt application developed in linux and it have a dependend libraries which we installed in to host and now we want to move the executable file alone to another system there i want though i don't have dependent libraries but also it should work. i came to know this is something called static linking of libraries by this way we can achive this but i didn't find any such process with detailed explanation.
    1)is any process to achive without having dependent libraries installed bin file itself should contains all libraries linkage.
    2)if that process is there is that called static linking libraries or did that any other process?
    3)How that librraies llinking will be done can someone explain me the deatailed procedure to do this.
    A Prior Thanks to every one.

    JKSHJ 1 Reply Last reply
    0
    • L Lavanya

      if we have a qt application developed in linux and it have a dependend libraries which we installed in to host and now we want to move the executable file alone to another system there i want though i don't have dependent libraries but also it should work. i came to know this is something called static linking of libraries by this way we can achive this but i didn't find any such process with detailed explanation.
      1)is any process to achive without having dependent libraries installed bin file itself should contains all libraries linkage.
      2)if that process is there is that called static linking libraries or did that any other process?
      3)How that librraies llinking will be done can someone explain me the deatailed procedure to do this.
      A Prior Thanks to every one.

      JKSHJ Offline
      JKSHJ Offline
      JKSH
      Moderators
      wrote on last edited by JKSH
      #2

      @Lavanya said in Static-linking of libraries to Qt application:

      i came to know this is something called static linking of libraries

      You don't need static linking. You just need to deploy the dynamic libraries with your app. See http://www.tripleboot.org/?p=138#Linux

      Note: Static linking is more difficult than dynamic deployment. If you really want to do static linking, then you must build all the Qt libraries yourself.

      Qt Doc Search for browsers: forum.qt.io/topic/35616/web-browser-extension-for-improved-doc-searches

      1 Reply Last reply
      2
      • L Offline
        L Offline
        Lavanya
        wrote on last edited by
        #3

        You mean only copying .so files in respective folders. But this is ok in linux what if i want to use in windows os.

        JKSHJ 1 Reply Last reply
        0
        • L Lavanya

          You mean only copying .so files in respective folders. But this is ok in linux what if i want to use in windows os.

          JKSHJ Offline
          JKSHJ Offline
          JKSH
          Moderators
          wrote on last edited by JKSH
          #4

          @Lavanya said in Static-linking of libraries to Qt application:

          You mean only copying .so files in respective folders.

          Yes.

          But this is ok in linux what if i want to use in windows os.

          You copy .dll files instead of .so files.

          See https://doc.qt.io/qt-5/windows-deployment.html

          Qt Doc Search for browsers: forum.qt.io/topic/35616/web-browser-extension-for-improved-doc-searches

          1 Reply Last reply
          2
          • L Offline
            L Offline
            Lavanya
            wrote on last edited by Lavanya
            #5

            @JKSH said in Static-linking of libraries to Qt application:You copy .dll files instead of .so files.

            .so files.

            But after compiling only .so files and also under usr folder they are getting creting so how to get dll files also in winodows rootf like won't be there know?

            jsulmJ JKSHJ 2 Replies Last reply
            0
            • L Lavanya

              @JKSH said in Static-linking of libraries to Qt application:You copy .dll files instead of .so files.

              .so files.

              But after compiling only .so files and also under usr folder they are getting creting so how to get dll files also in winodows rootf like won't be there know?

              jsulmJ Offline
              jsulmJ Offline
              jsulm
              Lifetime Qt Champion
              wrote on last edited by
              #6

              @Lavanya said in Static-linking of libraries to Qt application:

              But after compiling only .so files

              Do you build on Windows?

              https://forum.qt.io/topic/113070/qt-code-of-conduct

              1 Reply Last reply
              0
              • L Lavanya

                @JKSH said in Static-linking of libraries to Qt application:You copy .dll files instead of .so files.

                .so files.

                But after compiling only .so files and also under usr folder they are getting creting so how to get dll files also in winodows rootf like won't be there know?

                JKSHJ Offline
                JKSHJ Offline
                JKSH
                Moderators
                wrote on last edited by
                #7

                @Lavanya said in Static-linking of libraries to Qt application:

                But after compiling only .so files and also under usr folder they are getting creting so how to get dll files also in winodows rootf like won't be there know?

                If you want to build software for Windows, the easiest way is to set up a Windows development PC like @jsulm mentioned: Install Windows, install Qt on Windows, and install a compiler on Windows (Visual Studio or MinGW).

                Alternatively, you can install a cross-compiler on your Linux PC to build Windows software.

                Qt Doc Search for browsers: forum.qt.io/topic/35616/web-browser-extension-for-improved-doc-searches

                1 Reply Last reply
                1
                • L Offline
                  L Offline
                  Lavanya
                  wrote on last edited by Lavanya
                  #8

                  @JKSH said in Static-linking of libraries to Qt application:

                  1.I want to build qt application for desktop on ubuntu16.04 os.
                  2.I installed some libraries in ubuntu system since the qt application is dependent of those packages.
                  3.for installing those say e.g gstreamer i followed normal procedure like download source code,./configure,make,make install method
                  4.i locate the .so files [as this procedure creates only .so files not .a files]
                  5.Qt applivcation run succefully
                  6. Now i want to give this application by making the application static linking the library so that i can give client only bin file instead of what library i installed in my system noting down and letting client also do the same[since such dependent libraries i have many to be installed]
                  7.To do this i want a right procedure i tried many ways but for me nt worked to keep all .a files at one place i don't have .a files created in ubuntu.
                  8. How to change the .so files to .a for static linking i am not getting
                  9. Can some one please give me a procedure for my purspose to do especially on ubuntu16.04.
                  Sorry if i made a lengthy post.
                  Thanks in advance

                  jsulmJ 1 Reply Last reply
                  0
                  • L Lavanya

                    @JKSH said in Static-linking of libraries to Qt application:

                    1.I want to build qt application for desktop on ubuntu16.04 os.
                    2.I installed some libraries in ubuntu system since the qt application is dependent of those packages.
                    3.for installing those say e.g gstreamer i followed normal procedure like download source code,./configure,make,make install method
                    4.i locate the .so files [as this procedure creates only .so files not .a files]
                    5.Qt applivcation run succefully
                    6. Now i want to give this application by making the application static linking the library so that i can give client only bin file instead of what library i installed in my system noting down and letting client also do the same[since such dependent libraries i have many to be installed]
                    7.To do this i want a right procedure i tried many ways but for me nt worked to keep all .a files at one place i don't have .a files created in ubuntu.
                    8. How to change the .so files to .a for static linking i am not getting
                    9. Can some one please give me a procedure for my purspose to do especially on ubuntu16.04.
                    Sorry if i made a lengthy post.
                    Thanks in advance

                    jsulmJ Offline
                    jsulmJ Offline
                    jsulm
                    Lifetime Qt Champion
                    wrote on last edited by
                    #9

                    @Lavanya said in Static-linking of libraries to Qt application:

                    How to change the .so files to .a for static linking i am not getting

                    You have to build all dependencies as static libs. Static linking is not an easy task, you should really be carefull whether you want to do this. Instead of static linking you could deploy your app to get a package containing your app and needed libs. See https://doc.qt.io/qt-5/linux-deployment.html

                    https://forum.qt.io/topic/113070/qt-code-of-conduct

                    1 Reply Last reply
                    2

                    • Login

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