当我在mac中构建Qt 5.4时,我遇到了很多这样的错误:
Undefined symbols for architecture x86_64:
"_OBJC_CLASS_$_NSString", referenced from:
objc-class-ref in libQt5Bootstrap.a(qstring_mac.o)
"_FSFindFolder", referenced from:
macLocation(QStandardPaths::StandardLocation, short) in libQt5Bootstrap.a(qstandardpaths_mac.o)
...... ld:找不到架构x86_64的符号 clang:clang:错误:链接器命令失败,退出代码为1(使用-v查看调用)错误:链接器命令失败,退出代码为1(使用-v查看调用)
make[2]: make[2]: *** [../../../bin/rcc] Error 1*** [../../../bin/moc] Error 1
make[1]: *** [sub-rcc-make_first] Error 2
make[1]: *** Waiting for unfinished jobs....
make[1]: *** [sub-moc-make_first] Error 2
make: *** [sub-src-make_first] Error 2
知道导致这些错误的原因吗?
提前感谢您的帮助。
答案 0 :(得分:0)
我在Mac OS 10.9上构建新版本Qt 5.4.1时遇到了同样的问题
Mac-Build-DSBrowser:qt-src-static-5.4.1 jenkins $ ./configure -prefix $ PWD / qtbase -release -static -accessibility -qt-zlib -qt-libpng -qt-libjpeg -no- cups -no-sql-sqlite -no-qml-debug -nomake examples -nomake tests -skip qtactiveqt -skip qtenginio -skip qtlocation -skip qtmultimedia -skip qtserialport -skip qtquick1 -skip qtquickcontrols -skip qtscript -skip qtsensors -skip qtwebkit - 跳过qtwebsockets -skip qtxmlpatterns
然后使用make -j4