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. OSX Undefined symbols
Forum Updated to NodeBB v4.3 + New Features

OSX Undefined symbols

Scheduled Pinned Locked Moved Solved General and Desktop
8 Posts 2 Posters 884 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.
  • niqtN Offline
    niqtN Offline
    niqt
    wrote on last edited by
    #1

    Hi,
    compiling my desktop application with Qt-5.13.2 on Catalina using native object-c code, I have this linking errors:
    Undefined symbols for architecture x86_64:
    "OBJC_CLASS$_NSArray", referenced from:
    and others similar.

    Using Qt-5.14 everything is fine, but I must compile it with 5.13.2 or previous.

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

      Hi,

      @niqt said in OSX Undefined symbols:

      NSArray

      This class comes from the Foundation framework. You have to link to it.

      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
      • niqtN Offline
        niqtN Offline
        niqt
        wrote on last edited by
        #3

        Hi have it, -framework Foundation, i have the same links options for Qt5.13.2 and 14 but on the first one i have the error.

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

          Strange... Can you provide a minimal code sample that triggers this ?

          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
          • niqtN Offline
            niqtN Offline
            niqt
            wrote on last edited by
            #5

            @SGaist can download my test application here https://drive.google.com/open?id=1jDG_UxpX7Qp2qBfogSrW283acGR8m1Jh It's configurated for Qt5.14 so in the .pro there are not the OBJECTIVE_SOURCES and HEADERS that are necessary for Qt5.13.2

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

              You are missing LIBS += -framework Foundation -framework AppKit in your .pro file.

              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
              1
              • niqtN Offline
                niqtN Offline
                niqt
                wrote on last edited by
                #7

                @SGaist said in OSX Undefined symbols:

                LIBS += -framework Foundation -framework AppKit

                THanks, but why with Qt5.14 add ain automatic this dependecies and with Qt5.13.2 not?

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

                  I used a self compiled 5.14.0 and needed to add both frameworks.

                  In any case, it's always better to not rely on the fact that Qt (or any other library for that matter you are using) might link to a framework you want to use and thus have it in its list of dependencies. That might change at any point in time.

                  Be explicit, it's always better.

                  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
                  1

                  • Login

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