Unsolved Static-linking of libraries to Qt application
-
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. -
@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.
-
You mean only copying .so files in respective folders. But this is ok in linux what if i want to use in windows os.
-
@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.
-
@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?
-
@Lavanya said in Static-linking of libraries to Qt application:
But after compiling only .so files
Do you build on Windows?
-
@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.
-
@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 -
@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