Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Qt Creator and other tools
  4. [SOLVED] QtCreator on mac problem building own library inside a project
Forum Updated to NodeBB v4.3 + New Features

[SOLVED] QtCreator on mac problem building own library inside a project

Scheduled Pinned Locked Moved Qt Creator and other tools
11 Posts 3 Posters 3.3k 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.
  • SGaistS Offline
    SGaistS Offline
    SGaist
    Lifetime Qt Champion
    wrote on last edited by
    #2

    Hi,

    It's because on windows you are using a shared library and on unix a static one.

    You need to add

    @PRE_TARGETDEPS += "../bin/release/libNoctiMath.a"@

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

    1 Reply Last reply
    0
    • D Offline
      D Offline
      dianyu
      wrote on last edited by
      #3

      Hello, it works!

      Thank you very much for your reply!

      1 Reply Last reply
      0
      • D Offline
        D Offline
        dhjdhj
        wrote on last edited by
        #4

        I'm having a similar problem ---- I have .PRI files that have lines in them of the form
        @
        INCLUDEPATH *= $$PWD
        DEPENDPATH *= $$PWD
        HEADERS *= qtypes.h
        Conversions.h
        DSSettings.hpp
        MiscUtils.hpp
        SOURCES *= DSSettings.cpp
        MiscUtils.cpp
        @

        but the header and source files don't appear in QT Creator 3(and aren't found during compilation). This used to work when I was using QT4 (with whatever version of Creator was appropriate)

        I have observed that if I write
        @
        HEADERS *= $$PWD/qtypes.h ....
        @

        that works fine.

        I have checked with message that both INCLUDEPATH and PWD have the right values

        [edit: Added missing coding tags @ SGaist]

        1 Reply Last reply
        0
        • D Offline
          D Offline
          dhjdhj
          wrote on last edited by
          #5

          No one, huh?
          Sigh

          1 Reply Last reply
          0
          • SGaistS Offline
            SGaistS Offline
            SGaist
            Lifetime Qt Champion
            wrote on last edited by
            #6

            Doesn't it work when you add $$PWD in front of your files ?

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

            1 Reply Last reply
            0
            • D Offline
              D Offline
              dhjdhj
              wrote on last edited by
              #7

              Yes --- but I never had to do that with previous versions of Creator.

              Isn't that the whole point of INCLUDEPATH?

              1 Reply Last reply
              0
              • SGaistS Offline
                SGaistS Offline
                SGaist
                Lifetime Qt Champion
                wrote on last edited by
                #8

                No, with INCLUDEPATH you tell where to look for includes, however it won't show the file in these folders. It's the job of HEADERS and SOURCES

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

                1 Reply Last reply
                0
                • D Offline
                  D Offline
                  dhjdhj
                  wrote on last edited by
                  #9

                  Well, whatever it was, it used to work in the old Creator --- I'd have noticed a long time ago if those files weren't showing up, the project in question has been around for 4 years.

                  I would also add that (building under the current version of Qt Creator), ignoring their not showing up in the project tree, the files don't get found by the compiler either, even with INCLUDEPATH configured.

                  If INCLUDEPATH is supposed to be able to tell you where to look for stuff, then the system should be able to find them with explicit PWD prefixed as well.

                  1 Reply Last reply
                  0
                  • SGaistS Offline
                    SGaistS Offline
                    SGaist
                    Lifetime Qt Champion
                    wrote on last edited by
                    #10

                    INCLUDEPATH is a folder list for your compiler to search for includes

                    @INCLUDEPATH = /usr/local@

                    will result in

                    @gcc -I/usr/local@

                    It's not there for Qt Creator to show the files inside your project

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

                    1 Reply Last reply
                    0
                    • D Offline
                      D Offline
                      dhjdhj
                      wrote on last edited by
                      #11

                      Every one of my subfolder PRI files has the line

                      INCLUDEPATH *= $$PWD

                      so presumably that results in -I(value of PWD for that folder) so stuff should still be found.

                      In any case, I repeat my original issue -- in the old Qt Creator, the project was able to find all the files referenced in each .PRI file, WITHOUT the need to prefix the HEADER and SOURCES entries with $$PWD/

                      That doesn't work any more. So either it was a "flaw" that it used to work, or it is a bug that it doesn't work now.

                      Can't have it both ways.

                      1 Reply Last reply
                      0

                      • Login

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