Results 1 to 8 of 8

Thread: How to build a library from application

  1. #1
    Join Date
    Mar 2010
    Posts
    54
    Qt products
    Qt/Embedded
    Platforms
    Symbian S60

    Default How to build a library from application

    Hi

    I have a application and a library . Currently I am able to build the library and application separatly and link the application to it

    My case is that , when i import the application pro file, the qmake should be able to build the library and then run the application .

  2. #2
    Join Date
    Sep 2008
    Location
    Bangalore
    Posts
    659
    Thanks
    116
    Thanked 42 Times in 41 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: How to build a library from application

    just u reconfigure ur .pro file

    TEMPLATE = lib
    CONFIG += staticlib (or) CONFIG += dll

    it will automatically generate a library ...
    "Behind every great fortune lies a crime" - Balzac

  3. #3
    Join Date
    Jan 2006
    Location
    Belgium
    Posts
    1,938
    Thanked 268 Times in 268 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows
    Wiki edits
    20

    Default Re: How to build a library from application

    Quote Originally Posted by wagmare View Post
    just u reconfigure ur .pro file

    TEMPLATE = lib
    CONFIG += staticlib (or) CONFIG += dll

    it will automatically generate a library ...
    What about the main function?
    What about the event loop?

  4. #4
    Join Date
    Mar 2010
    Posts
    54
    Qt products
    Qt/Embedded
    Platforms
    Symbian S60

    Default Re: How to build a library from application

    Attached is the pro file for the application (scrapbook ) and the library( gallery)
    I need to reconfigure the pro file for scrapbook so that , qmake builds gallery and then scrapboook automatially
    Attached Files Attached Files

  5. #5
    Join Date
    Sep 2008
    Location
    Bangalore
    Posts
    659
    Thanks
    116
    Thanked 42 Times in 41 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: How to build a library from application

    Quote Originally Posted by tbscope View Post
    What about the main function?
    What about the event loop?
    no need for main and QApplication event loop .. the application where u want to include this widget having event loop is enough ....
    "Behind every great fortune lies a crime" - Balzac

  6. #6
    Join Date
    Mar 2010
    Posts
    54
    Qt products
    Qt/Embedded
    Platforms
    Symbian S60

    Default Re: How to build a library from application

    I included
    SUBDIRS + = /path to GALL.pro
    in the scrapbook.pro , but I get error
    make: *** No rule to make target `../libs/libGALLERY.so

  7. #7
    Join Date
    Jan 2006
    Location
    Belgium
    Posts
    1,938
    Thanked 268 Times in 268 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows
    Wiki edits
    20

    Default Re: How to build a library from application

    Quote Originally Posted by wagmare View Post
    no need for main and QApplication event loop .. the application where u want to include this widget having event loop is enough ....
    Which means you can't turn an application into a library by just changing the .pro file?
    Or do I miss something here?

    Edit: I might also misinterpret the original question. Does the original question ask for an application to be turned into a library or not?

  8. #8
    Join Date
    Mar 2010
    Posts
    54
    Qt products
    Qt/Embedded
    Platforms
    Symbian S60

    Default Re: How to build a library from application

    My question was that when the QMAKE builds the scrapbook.pro , it should internally go to Gall.pro and create the libraries
    currently , I have to explicitly build the Gall libraries

Similar Threads

  1. i want build My project use VLC library on QT
    By nhs_0702 in forum Qt Programming
    Replies: 1
    Last Post: 13th March 2010, 06:41
  2. Replies: 1
    Last Post: 13th January 2010, 23:35
  3. Replies: 3
    Last Post: 28th December 2007, 11:02
  4. library not build automatically
    By KoosKoets in forum Qt Programming
    Replies: 1
    Last Post: 26th March 2007, 13:43
  5. Replies: 7
    Last Post: 11th March 2006, 15:51

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.