Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-61202

Undefined symbols: QHash::~QHash on macOs

    XMLWordPrintable

Details

    • Bug
    • Resolution: Out of scope
    • Not Evaluated
    • None
    • 5.8.0, 5.9.0
    • Core: Other
    • None
    • * macOs 10.12.5
       * Xcode 8.3
       * Qt 5.8 or 5.9 (both)
       * clang 64bit
       * release build
    • macOS

    Description

      When I try to build my library for macOs, it fails for the release build with an undefined symbols error. ThisĀ only happens for release builds with clang_64 on mac. All other platforms and configurations are fine.

      It seems clang is not able to "find" the QHash destructor. The full error is:

      Undefined symbols for architecture x86_64:
      "QHash<QByteArray, QByteArray>::~QHash()", referenced from:
      void QtRestClient::Simple<JphPost*, void>::extend<QObject*>(QtRestClient::RestClient*, std::__1::function<void (JphPost*, bool)>, std::__1::function<void (QString, int, QtRestClient::RestReply::ErrorType)>, std::__1::function<QString (QObject*, int)>) in tst_restreply.o
      QtRestClient::GenericRestReply<JphPost*, QObject*>* QtRestClient::Simple<JphPost*, void>::extend<QObject*>(QtRestClient::RestClient*) in tst_restreply.o
      ld: symbol(s) not found for architecture x86_64
      clang: error: linker command failed with exit code 1 (use -v to see invocation)
      

      For reference, the source files to this error.

      Note: Since those are generic versions, the error appears first when compiling the test.

      When creating such a QHash directly, i.e. in the main, it works fine, so the symbol should be present.

      Attachments

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            thiago Thiago Macieira
            SkyCoder Felix Barz
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes