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. Unable to add Internal Library to project even though its .pro file exists.
QtWS25 Last Chance

Unable to add Internal Library to project even though its .pro file exists.

Scheduled Pinned Locked Moved Unsolved General and Desktop
4 Posts 2 Posters 1.9k Views
  • 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.
  • enjoysmathE Offline
    enjoysmathE Offline
    enjoysmath
    wrote on last edited by
    #1

    See this screen shot? There's nothing listed in the Library: combobox. I have a folder selected that is in the build tree on the left and it has a functor.pro file inside of it.

    0_1551312799449_491f1c66-0f52-4d95-8ebf-0fe9501fc485-image.png

    How can I add an internal library to an Qt Widgets App?

    https://github.com/enjoysmath
    https://math.stackexchange.com/users/26327/exercisingmathematician

    1 Reply Last reply
    0
    • JKSHJ Offline
      JKSHJ Offline
      JKSH
      Moderators
      wrote on last edited by JKSH
      #2

      Here, "Internal" means "within the same SUBDIRS project". This is not directly documented but is implied at https://doc.qt.io/qtcreator/creator-project-qmake-libraries.html#example-of-adding-internal-libraries

      (See also https://doc.qt.io/qtcreator/creator-project-creating.html#adding-subprojects-to-projects)

      You need a top-level SUBDIRS project that contains both your main banana_cats_cpp project and your functor project:

      # Root.pro
      
      TEMPLATE = subdirs
      
      SUBDIRS += \
          /path/to/banana_cats_cpp \
          /path/to/functor
      

      Close everything, then re-open the Root project. In the Projects pane, right-click banana_cats_cpp (which should now be nested under Root) and select Add Library.... functor should now be selectable as an Internal Library.

      Personally, I prefer to just use External Libraries

      Qt Doc Search for browsers: forum.qt.io/topic/35616/web-browser-extension-for-improved-doc-searches

      1 Reply Last reply
      4
      • enjoysmathE Offline
        enjoysmathE Offline
        enjoysmath
        wrote on last edited by
        #3

        @JKSH interesting, how would you do an external library plugin?

        https://github.com/enjoysmath
        https://math.stackexchange.com/users/26327/exercisingmathematician

        JKSHJ 1 Reply Last reply
        0
        • enjoysmathE enjoysmath

          @JKSH interesting, how would you do an external library plugin?

          JKSHJ Offline
          JKSHJ Offline
          JKSH
          Moderators
          wrote on last edited by JKSH
          #4

          @enjoysmath said in Unable to add Internal Library to project even though its .pro file exists.:

          interesting, how would you do an external library plugin?

          Oh, a plugin?

          Typically, an application searches for (optional) plugins at runtime; you don't need to add plugin libraries to your .pro file. See https://doc.qt.io/qt-5/qtwidgets-tools-echoplugin-example.html for a simple example.

          Adding libraries to your project (either internal or external libraries) is typically done for required dependencies, not for plugins.

          Let's take a step back: What's the purpose of these plugins? Do you want a plugin library, or do you just want a "regular" library?

          Qt Doc Search for browsers: forum.qt.io/topic/35616/web-browser-extension-for-improved-doc-searches

          1 Reply Last reply
          4

          • Login

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