Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. How to create both a library and app from .pro file?
Forum Updated to NodeBB v4.3 + New Features

How to create both a library and app from .pro file?

Scheduled Pinned Locked Moved Solved General and Desktop
3 Posts 2 Posters 319 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • H Offline
    H Offline
    HunterMetcalfe
    wrote on 18 May 2019, 21:04 last edited by
    #1

    The title says it all! I'm not necessarily the best when it comes to pro files. I know how to create an executable and a library but not together in the same Makefile. I'd like to see something like libmyapp.a and then myapp (executable) after my application builds. Further, how does one create both a debug and release executable?

    1 Reply Last reply
    0
    • S Offline
      S Offline
      SGaist
      Lifetime Qt Champion
      wrote on 18 May 2019, 21:12 last edited by
      #2

      Hi and welcome to devnet,

      The simplest and cleanest is to use the SUBDIRS template.

      You'll have then two different projects. One for handling your library and one for your application.

      As for your last question: you build it twice. Once for each mode.

      Interested in AI ? www.idiap.ch
      Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

      H 1 Reply Last reply 18 May 2019, 21:50
      2
      • S SGaist
        18 May 2019, 21:12

        Hi and welcome to devnet,

        The simplest and cleanest is to use the SUBDIRS template.

        You'll have then two different projects. One for handling your library and one for your application.

        As for your last question: you build it twice. Once for each mode.

        H Offline
        H Offline
        HunterMetcalfe
        wrote on 18 May 2019, 21:50 last edited by
        #3

        @SGaist Thanks! I did just that. Moved all of my files into a library directory and only a main into an app directory with their own individual .pro files and it worked. I appreciate it.

        1 Reply Last reply
        1

        1/3

        18 May 2019, 21:04

        • Login

        • Login or register to search.
        1 out of 3
        • First post
          1/3
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • Users
        • Groups
        • Search
        • Get Qt Extensions
        • Unsolved