3 Replies - 748 Views - Last Post: 07 September 2012 - 05:58 AM

#1 TwoOfDiamonds  Icon User is offline

  • D.I.C Regular

Reputation: 54
  • View blog
  • Posts: 272
  • Joined: 27-July 12

Linux Dependencies

Posted 07 September 2012 - 01:40 AM

Hello!

I created an application that will run on Linux but I didn't get any library request at run (as it happens in Windows)
For example if you create an application with Qt on Windows it will ask for the .dll files that Qt needs , this didn't happen on Linux . Does that mean I can just upload the executable and whoever will download it and run it will have no problems or should I , somehow, find the dependencies and put them in the same archive (or whatever I'll use) .

Thank you .

Is This A Good Question/Topic? 0
  • +

Replies To: Linux Dependencies

#2 RudiVisser  Icon User is offline

  • .. does not guess solutions
  • member icon

Reputation: 1001
  • View blog
  • Posts: 3,555
  • Joined: 05-June 09

Re: Linux Dependencies

Posted 07 September 2012 - 02:02 AM

No, Qt is generally a package on Linux, and is probably installed as a dependency of another application so your system will find it.

In Windows, not so much, which is why it asks you to get them yourself. If you were to uninstall the Qt package from Linux, you would get a .so not found error, just like the .dll error you get on Windows.

You should definitely distribute your dependencies, statically link against them (will increase size of your executable and make updates bigger), or simply say that it depends on [package] version [version] and above.

This post has been edited by RudiVisser: 07 September 2012 - 02:03 AM

Was This Post Helpful? 1
  • +
  • -

#3 TwoOfDiamonds  Icon User is offline

  • D.I.C Regular

Reputation: 54
  • View blog
  • Posts: 272
  • Joined: 27-July 12

Re: Linux Dependencies

Posted 07 September 2012 - 02:09 AM

View PostRudiVisser, on 07 September 2012 - 12:02 PM, said:

No, Qt is generally a package on Linux, and is probably installed as a dependency of another application so your system will find it.

In Windows, not so much, which is why it asks you to get them yourself. If you were to uninstall the Qt package from Linux, you would get a .so not found error, just like the .dll error you get on Windows.



I uninstalled Qt for this purpose , and nothing bad happened .

View PostRudiVisser, on 07 September 2012 - 12:02 PM, said:

You should definitely distribute your dependencies, statically link against them (will increase size of your executable and make updates bigger), or simply say that it depends on [package] version [version] and above.



How do I do this ?
Was This Post Helpful? 0
  • +
  • -

#4 sepp2k  Icon User is offline

  • D.I.C Lover
  • member icon

Reputation: 2013
  • View blog
  • Posts: 3,038
  • Joined: 21-June 11

Re: Linux Dependencies

Posted 07 September 2012 - 05:58 AM

The last one you do by putting the text "requires QT" on the homepage of your application. The other two aren't actually recommended.

The recommended way to distribute binaries of your application for Linux is to create a distribution-specific binary package for the application. For Ubuntu those packages would have the .deb format. The package will contain the binary for your application (and any other files that might belong to your application) as well as some meta information about it. Part of that meta information are the dependencies, i.e. the package contains the information which other packages it depends on. When the user then tries to install your application through the package, the package manager will automatically install the dependencies.

The down-side of this is that it's distribution-specific, i.e. you need to create one such package for every distribution you support. However a plain binary will often also only work on the distribution you compiled it on (because of library versions and what not), so that's not the solution either.

Static linking can solve the library-version problem, but it comes with its own sets of problems: As Rudi said, your binary will become (a lot) bigger. Also its somewhat more complicated to build a static application and not all libraries actually play well with being statically linked.

The usual way to distribute your application for Linux is to provide a binary package for your favorite distribution (plus Ubuntu probably if that isn't your favorite distribution - Ubuntu being the most widely used Linux distribution) and provide your source code for every one else, so that they can compile it themselves.
Was This Post Helpful? 2
  • +
  • -

Page 1 of 1