Dynamic vs. static in Linux (DLL analogs in Linux)
Hi,
I know how to compile Qt apps statically and dynamically in Windows. Now I'm trying to do the same in Linux.
My questions:
1. Windows Qt has DLL's which you can put in the same folder with your compiled program if you compiled dynamically. What are the Linux analogs of DLL? Where are they located in Ubuntu? Do they work the same as in Win (i.e. simply put the right ones in the same folder with your executable)?
2. Are there any instructions on how to compile statically for Linux?
Thanks!
Re: Dynamic vs. static in Linux (DLL analogs in Linux)
Quote:
Originally Posted by
timmu
What are the Linux analogs of DLL?
Files with "so" (shared object) extension.
Quote:
Where are they located in Ubuntu?
Usually in system directories under /usr/lib or /usr/local/lib but you can point the linker elsewhere using LD_LIBRARY_PATH.
Quote:
Do they work the same as in Win (i.e. simply put the right ones in the same folder with your executable)?
No, that would be a stupid security risk.
Quote:
2. Are there any instructions on how to compile statically for Linux?
Build static Qt libs (and possibly other libraries you want static) and link your application against them just like you do with Windows.
Re: Dynamic vs. static in Linux (DLL analogs in Linux)
Hi,
Thanks for your help.
I typically compile my program like this:
qmake -project
qmake
make
This compiles dynamically. How do I compile statically? I'm assuming that the pro file will have to be changed by inserting a couple of new rows before I do "make". Is that correct? But how, are there instructions on how to change the pro file?
Thanks!
Re: Dynamic vs. static in Linux (DLL analogs in Linux)
Quote:
Originally Posted by
timmu
How do I compile statically?
[wiki]Building static applications[/wiki]
Re: Dynamic vs. static in Linux (DLL analogs in Linux)
Thanks, Wysota
I actually also found that link. But it seems that I need to build Qt itself statically to compile statically. How is that done? And is it going to interfere with the dynamic version of Qt which I currently have on my computer?
Re: Dynamic vs. static in Linux (DLL analogs in Linux)
Quote:
Originally Posted by
timmu
I actually also found that link. But it seems that I need to build Qt itself statically to compile statically. How is that done?
Everything is described in the wiki.
Quote:
And is it going to interfere with the dynamic version of Qt which I currently have on my computer?
No.