Compiling Qt5 (5.0.1 & 5.0.2) in Release mode results WebKit linking errors
-
Hi all :)
I'm trying to build Qt5 (5.0.1 & 5.0.2) in release mode and the build breaks when building QWebProcess with the following error[1]:
ld: library not found for -lQt5WebKitWidgetsI see it is the same problem as described in this post:
https://qtforum.de/forum/viewtopic.php?f=3&t=15672 - however there is no solution there.The build works when compiling Qt5 with -debug_and_release, but it seems that the Debug libraries get mixed up with the release libraries, as when I compile and run my program on release mode, I get the following output on QtCreator:
On Mac OS X, you might be loading two sets of Qt binaries into the same process. Check that all plugins are compiled against the right Qt binaries. Export DYLD_PRINT_LIBRARIES=1 and check that only one set of binaries are being loaded.
I did export the DYLD_PRINT_LIBRARIES=1 variable, and indeed the debug libraries get mixed, that's why I'm trying to compile on release mode.
Thanks in avance,
Jayaedit:
I think I understand what is going on, it builds the library with the name libQtWebKitWidgets and looks for the libQt5WebKitWidgets (note the 5 after Qt). Since I think this is a bug, I created an issue for it: https://bugreports.qt-project.org/browse/QTBUG-30466[1] make output:
ln -s libQtWebKitWidgets.5.0.2.dylib libQtWebKitWidgets.dylib
ln -s libQtWebKitWidgets.5.0.2.dylib libQtWebKitWidgets.5.dylib
ln -s libQtWebKitWidgets.5.0.2.dylib libQtWebKitWidgets.5.0.dylib
rm -f ../lib/libQtWebKitWidgets.5.0.2.dylib
rm -f ../lib/libQtWebKitWidgets.dylib
rm -f ../lib/libQtWebKitWidgets.5.dylib
rm -f ../lib/libQtWebKitWidgets.5.0.dylib
mv -f libQtWebKitWidgets.5.0.2.dylib libQtWebKitWidgets.dylib libQtWebKitWidgets.5.dylib libQtWebKitWidgets.5.0.dylib ../lib/
cd WebKit2/ && ( test -e Makefile.WebProcess || /Users/discipline/Developer/Qt/source/qt-everywhere-opensource-src-5.0.2/qtbase/bin/qmake /Users/discipline/Developer/Qt/source/qt-everywhere-opensource-src-5.0.2/qtwebkit/Source/WebKit2/WebProcess.pro -o Makefile.WebProcess ) && make -f Makefile.WebProcess
clang++ -c -pipe -mmacosx-version-min=10.6 -Wno-c++11-extensions -Wno-c++0x-extensions -O2 -fno-exceptions -fPIE -MD -DQT_EDITION=QT_EDITION_DESKTOP -DQT_NO_LIBUDEV -DQT_NO_EVDEV -DQT_NO_XCB -DHAVE_WEBKIT1// tuncating some output
-DQT_WEBKITWIDGETS_LIB -DQT_QUICK_LIB -DQT_OPENGL_LIB -DQT_PRINTSUPPORT_LIB -DQT_QML_LIB -DQT_WEBKIT_LIB -DQT_WIDGETS_LIB -DQT_XML_LIB -DQT_NETWORK_LIB -DQT_GUI_LIB -DQT_CORE_LIB -I/Users/discipline/Developer/Qt/source/qt-everywhere-opensource-src-5.0.2/qtbase/mkspecs/macx-clang -I. -I../../Source -I../include -I/Users/discipline/Developer/Qt/source/qt-everywhere-opensource-src-5.0.2/qtscript/include -I/Users/discipline/Developer/Qt/source/qt-everywhere-opensource-src-5.0.2/qtscript/include/QtScript -I../../include -I../../include/QtWebKitWidgets -I/Users/discipline/Developer/Qt/source/qt-everywhere-opensource-src-5.0.2/qtdeclarative/include -I/Users/discipline/Developer/Qt/source/qt-everywhere-opensource-src-5.0.2/qtdeclarative/include/QtQuick -I/Users/discipline/Developer/Qt/source/qt-everywhere-opensource-src-5.0.2/qtbase/include -I/Users/discipline/Developer/Qt/source/qt-everywhere-opensource-src-5.0.2/qtbase/include/QtOpenGL -I/Users/discipline/Developer/Qt/source/qt-everywhere-opensource-src-5.0.2/qtbase/include/QtPrintSupport -I/Users/discipline/Developer/Qt/source/qt-everywhere-opensource-src-5.0.2/qtdeclarative/include/QtQml -I../../include/QtWebKit -I/Users/discipline/Developer/Qt/source/qt-everywhere-opensource-src-5.0.2/qtbase/include/QtWidgets -I/Users/discipline/Developer/Qt/source/qt-everywhere-opensource-src-5.0.2/qtbase/include/QtXml -I/Users/discipline/Developer/Qt/source/qt-everywhere-opensource-src-5.0.2/qtbase/include/QtNetwork -I/Users/discipline/Developer/Qt/source/qt-everywhere-opensource-src-5.0.2/qtbase/include/QtGui -I/Users/discipline/Developer/Qt/source/qt-everywhere-opensource-src-5.0.2/qtbase/include/QtCore -I.moc/release-shared -I/System/Library/Frameworks/OpenGL.framework/Versions/A/Headers -I/System/Library/Frameworks/AGL.framework/Headers -o .obj/release-shared/qt/MainQt.o qt/MainQt.cpp
clang++ -headerpad_max_install_names -mmacosx-version-min=10.6 -o ../../bin/QtWebProcess .obj/release-shared/qt/MainQt.o -L/Users/discipline/Developer/Qt/source/qt-everywhere-opensource-src-5.0.2/qtwebkit/lib -lQt5WebKitWidgets -L/Users/discipline/Developer/Qt/source/qt-everywhere-opensource-src-5.0.2/qtdeclarative/lib -lQt5Quick -L/Users/discipline/Developer/Qt/source/qt-everywhere-opensource-src-5.0.2/qtbase/lib -lQt5OpenGL -lQt5PrintSupport -framework Cocoa -lQt5Qml -lQt5WebKit -lQt5Widgets -lQt5Xml -lQt5Network -lQt5Gui -lQt5Core -framework OpenGL -framework AGL
ld: library not found for -lQt5WebKitWidgets
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make[3]: *** [../../bin/QtWebProcess] Error 1
make[2]: *** [sub-WebKit2-WebProcess-pro-make_first-ordered] Error 2
make[1]: *** [sub-Source-QtWebKit-pro-make_first-ordered] Error 2
make: *** [module-qtwebkit-make_first] Error 2 -
*** post deleted in favor of updating the original post ***