Details
-
Bug
-
Resolution: Out of scope
-
Not Evaluated
-
None
-
5.8.0, 5.9.0
-
None
-
* macOs 10.12.5
* Xcode 8.3
* Qt 5.8 or 5.9 (both)
* clang 64bit
* release build
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.
- https://github.com/Skycoder42/QtRestClient/blob/master/src/restclient/simple.h#L151
- https://github.com/Skycoder42/QtRestClient/blob/master/src/restclient/simple.h#L164
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.