Results 1 to 2 of 2

Thread: Static linking problem in Linux

  1. #1
    Join Date
    Oct 2009
    Posts
    2
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Static linking problem in Linux

    I have a project that consists of a couple of components, each built as a separate static library. However, when one static library is updated, the main executable is not relinked if it already exists. As a workaround, I'm currently removing the final binary file before calling make on the project.

    Is there some directive I can give to the pro file to either automatically remove the binary file before compiling or force a relink if a static library has been updated since the last build?

    The build system looks like this:

    - project.pro (TEMPLATE = subdirs; SUBDIRS = component1, component2, main)
    - component1/
    --- component1.pro (TEMPLATE = lib; CONFIG += staticlib)
    - component2/
    --- component2.pro (TEMPLATE = lib; CONFIG += staticlib)
    - main/
    --- main.pro (TEMPLATE = app; LIBS += -L../component1 -L../component2 -lcomponent1 -lcomponent2)

  2. #2
    Join Date
    Oct 2009
    Posts
    2
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Static linking problem in Linux

    Answering my own question: by using the TARGETDEPS variable in a pro file.
    ex. in build.pro "TARGETDEPS += ../component1/libcomponent1.a"

Similar Threads

  1. Linking to a static library on Windows
    By rexi in forum Qt Programming
    Replies: 9
    Last Post: 27th July 2009, 19:54
  2. Static linking in Linux
    By anupamgee in forum Qt Programming
    Replies: 4
    Last Post: 2nd June 2009, 14:34
  3. problem with deploying static application in windows
    By remy06 in forum Installation and Deployment
    Replies: 3
    Last Post: 2nd June 2009, 06:46
  4. Problem with libmng on static link
    By jlbrd in forum Installation and Deployment
    Replies: 2
    Last Post: 10th May 2006, 22:38
  5. Replies: 4
    Last Post: 20th February 2006, 09:11

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.