Recent

Author Topic: How to static link a single executable  (Read 8924 times)

cookie22

  • New Member
  • *
  • Posts: 16
How to static link a single executable
« on: August 18, 2013, 05:41:50 pm »
Hello,

what do I have to do to static link a single qt executable file?


cookie22

  • New Member
  • *
  • Posts: 16
Re: How to static link a single executable
« Reply #2 on: August 18, 2013, 06:54:33 pm »
Thx, for the Links but it says nothing and does not answer my Question.

How do I link static Qt and what files to I need to link?

exdatis

  • Hero Member
  • *****
  • Posts: 668
    • exdatis

cookie22

  • New Member
  • *
  • Posts: 16
Re: How to static link a single executable
« Reply #4 on: August 18, 2013, 07:10:15 pm »
No info about static linking on that site. :(

exdatis

  • Hero Member
  • *****
  • Posts: 668
    • exdatis
Re: How to static link a single executable
« Reply #5 on: August 18, 2013, 07:14:07 pm »
Do you see links:
http://wiki.freepascal.org/Qt4_binding
Is that it?

cookie22

  • New Member
  • *
  • Posts: 16
Re: How to static link a single executable
« Reply #6 on: August 18, 2013, 07:28:03 pm »
Yes, I see but where is there something about static linking? I can't see anything.

exdatis

  • Hero Member
  • *****
  • Posts: 668
    • exdatis
Re: How to static link a single executable
« Reply #7 on: August 18, 2013, 07:32:43 pm »
« Last Edit: August 18, 2013, 07:35:03 pm by exdatis »

cookie22

  • New Member
  • *
  • Posts: 16
Re: How to static link a single executable
« Reply #8 on: August 18, 2013, 08:56:03 pm »
The question now is witch libs do I need to link? libQtPas.so and libQtCore.so does not seem to be enough.

exdatis

  • Hero Member
  • *****
  • Posts: 668
    • exdatis
Re: How to static link a single executable
« Reply #9 on: August 18, 2013, 09:05:00 pm »
I found this article: http://www.formortals.com/how-to-statically-link-qt-4/
Maybe usefull...

cookie22

  • New Member
  • *
  • Posts: 16
Re: How to static link a single executable
« Reply #10 on: August 19, 2013, 01:52:33 pm »
Link is dead. :(

exdatis

  • Hero Member
  • *****
  • Posts: 668
    • exdatis
Re: How to static link a single executable
« Reply #11 on: August 19, 2013, 04:13:13 pm »
No, it working(to me), try this:
http://qt-project.org/search/tag/static~linking

exdatis

  • Hero Member
  • *****
  • Posts: 668
    • exdatis

exdatis

  • Hero Member
  • *****
  • Posts: 668
    • exdatis
Re: How to static link a single executable
« Reply #13 on: August 19, 2013, 04:27:30 pm »
cookie22 : "Link is dead. :("
use
http://www.formortals.com/
and search string(edit box from site) "static linking"
« Last Edit: August 19, 2013, 04:31:08 pm by exdatis »

marcov

  • Administrator
  • Hero Member
  • *
  • Posts: 11446
  • FPC developer.
Re: How to static link a single executable
« Reply #14 on: August 19, 2013, 06:22:48 pm »
The question now is witch libs do I need to link? libQtPas.so and libQtCore.so does not seem to be enough.

Roughly .a versions of all libs linked dynamically (check with ldd ./dynamicapp), and some more from system. (like libc,libpthreads etc). In theory
passing -Xt should convince FPC to pass -static to the linker.

However linking massive frameworks like QT is not trivial, and there probably will be problems.  For more information about QT specific linking contact QT.

Use fpc -s  to stop linking and then examine ppas.sh.   You can use that as a base for your manual linking experiments.

 

TinyPortal © 2005-2018