MSYS2 unable to compile QT 5.15.2
-
Dear QT users,
I have setup an MSYS2 environment exactly like this tutorial here http://www.logikalsolutions.com/wordpress/information-technology/compiling-qt-5-14-under-msys2/.
I would like to build a static QT version that works on Windows.
However, when running the configure command exactly as described in that tutorial, I receive the following error:
.D:/msys64/home/Hamzan/Src/qtbase/qmake/main.cpp: In function ‘int installFileOrDirectory(const QString&, const QString&, bool)’: D:/msys64/home/Hamzan/Src/qtbase/qmake/main.cpp:331:15: error: ‘::symlink’ has not been declared 331 | if (::symlink(linkTarget.toLocal8Bit().constData(), target.toLocal8Bit().constData()) < 0) { | ^~~~~~~ make: *** [Makefile:258: main.o] Error 1
I do not understand? Nothing comes up on Google.
-
Why do you think you need msys for this? Simply install the MinGW compiler (e.g. via the Qt online installer) and compile Qt on a plain windows command line.
-
Because compiling on windows always gives me errors.
g++ -c -fno-keep-inline-dllexport -O2 -std=c++1z -fno-exceptions -Wall -Wextra -Wextra -Wvla -Wdate-time -Wshift-overflow=2 -Wduplicated-cond -Wno-stringop-overflow -ffunction-sections -fdata-sections -DUNICODE -D_UNICODE -DWIN32 -DMINGW_HAS_SECURE_API=1 -DQT_STATIC_BUILD -DWINVER=0x0601 -D_WIN32_WINNT=0x0601 -DQT_NO_LINKED_LIST -DQT_NO_JAVA_STYLE_ITERATORS -DQT_NO_CAST_FROM_ASCII -DQT_NO_FOREACH -DLIBEGL_NAME=libEGL -DLIBGLESV2_NAME=libGLESv2 -DQT_DEPRECATED_WARNINGS -DQT_NO_NARROWING_CONVERSIONS_IN_CONNECT -DQT_NO_EXCEPTIONS -DQT_NO_DEBUG -DQT_STATICPLUGIN -DQT_PLUGIN -DQT_EVENTDISPATCHER_SUPPORT_LIB -DQT_FONTDATABASE_SUPPORT_LIB -DQT_THEME_SUPPORT_LIB -DQT_ACCESSIBILITY_SUPPORT_LIB -DQT_WINDOWSUIAUTOMATION_SUPPORT_LIB -DQT_GUI_LIB -DQT_CORE_LIB -DQT_PLUGIN_RESOURCE_INIT_FUNCTION=qdirect2d_plugin_resource_init -I. -I..\windows -I..\..\..\3rdparty\wintab -I..\..\..\..\include -I..\..\..\..\include\QtEventDispatcherSupport -I..\..\..\..\include\QtEventDispatcherSupport\5.15.2 -I..\..\..\..\include\QtEventDispatcherSupport\5.15.2\QtEventDispatcherSupport -I..\..\..\..\include\QtFontDatabaseSupport -I..\..\..\..\include\QtFontDatabaseSupport\5.15.2 -I..\..\..\..\include\QtFontDatabaseSupport\5.15.2\QtFontDatabaseSupport -I..\..\..\..\include\QtThemeSupport -I..\..\..\..\include\QtThemeSupport\5.15.2 -I..\..\..\..\include\QtThemeSupport\5.15.2\QtThemeSupport -I..\..\..\..\include\QtAccessibilitySupport -I..\..\..\..\include\QtAccessibilitySupport\5.15.2 -I..\..\..\..\include\QtAccessibilitySupport\5.15.2\QtAccessibilitySupport -I..\..\..\..\include\QtWindowsUIAutomationSupport -I..\..\..\..\include\QtWindowsUIAutomationSupport\5.15.2 -I..\..\..\..\include\QtWindowsUIAutomationSupport\5.15.2\QtWindowsUIAutomationSupport -I..\..\..\..\include\QtGui\5.15.2 -I..\..\..\..\include\QtGui\5.15.2\QtGui -I..\..\..\..\include\QtGui -I..\..\..\..\include\QtCore\5.15.2 -I..\..\..\..\include\QtCore\5.15.2\QtCore -I..\..\..\..\include\QtCore -I.moc\release -I..\..\..\..\mkspecs\win32-g++ -o .obj\release\moc_qwindowsdirect2dnativeinterface.o .moc\release\moc_qwindowsdirect2dnativeinterface.cpp g++ -c -fno-keep-inline-dllexport -O2 -std=c++1z -fno-exceptions -Wall -Wextra -Wextra -Wvla -Wdate-time -Wshift-overflow=2 -Wduplicated-cond -Wno-stringop-overflow -ffunction-sections -fdata-sections -DUNICODE -D_UNICODE -DWIN32 -DMINGW_HAS_SECURE_API=1 -DQT_STATIC_BUILD -DWINVER=0x0601 -D_WIN32_WINNT=0x0601 -DQT_NO_LINKED_LIST -DQT_NO_JAVA_STYLE_ITERATORS -DQT_NO_CAST_FROM_ASCII -DQT_NO_FOREACH -DLIBEGL_NAME=libEGL -DLIBGLESV2_NAME=libGLESv2 -DQT_DEPRECATED_WARNINGS -DQT_NO_NARROWING_CONVERSIONS_IN_CONNECT -DQT_NO_EXCEPTIONS -DQT_NO_DEBUG -DQT_STATICPLUGIN -DQT_PLUGIN -DQT_EVENTDISPATCHER_SUPPORT_LIB -DQT_FONTDATABASE_SUPPORT_LIB -DQT_THEME_SUPPORT_LIB -DQT_ACCESSIBILITY_SUPPORT_LIB -DQT_WINDOWSUIAUTOMATION_SUPPORT_LIB -DQT_GUI_LIB -DQT_CORE_LIB -DQT_PLUGIN_RESOURCE_INIT_FUNCTION=qdirect2d_plugin_resource_init -I. -I..\windows -I..\..\..\3rdparty\wintab -I..\..\..\..\include -I..\..\..\..\include\QtEventDispatcherSupport -I..\..\..\..\include\QtEventDispatcherSupport\5.15.2 -I..\..\..\..\include\QtEventDispatcherSupport\5.15.2\QtEventDispatcherSupport -I..\..\..\..\include\QtFontDatabaseSupport -I..\..\..\..\include\QtFontDatabaseSupport\5.15.2 -I..\..\..\..\include\QtFontDatabaseSupport\5.15.2\QtFontDatabaseSupport -I..\..\..\..\include\QtThemeSupport -I..\..\..\..\include\QtThemeSupport\5.15.2 -I..\..\..\..\include\QtThemeSupport\5.15.2\QtThemeSupport -I..\..\..\..\include\QtAccessibilitySupport -I..\..\..\..\include\QtAccessibilitySupport\5.15.2 -I..\..\..\..\include\QtAccessibilitySupport\5.15.2\QtAccessibilitySupport -I..\..\..\..\include\QtWindowsUIAutomationSupport -I..\..\..\..\include\QtWindowsUIAutomationSupport\5.15.2 -I..\..\..\..\include\QtWindowsUIAutomationSupport\5.15.2\QtWindowsUIAutomationSupport -I..\..\..\..\include\QtGui\5.15.2 -I..\..\..\..\include\QtGui\5.15.2\QtGui -I..\..\..\..\include\QtGui -I..\..\..\..\include\QtCore\5.15.2 -I..\..\..\..\include\QtCore\5.15.2\QtCore -I..\..\..\..\include\QtCore -I.moc\release -I..\..\..\..\mkspecs\win32-g++ -o .obj\release\qwindowsdialoghelpers.o ..\windows\qwindowsdialoghelpers.cpp del ..\..\..\..\plugins\platforms\libqdirect2d.a 2>NUL ar -rc ..\..\..\..\plugins\platforms\libqdirect2d.a @object_script.libqdirect2d.Release D:\QTCompile\Static\src\qt-everywhere-src-5.15.2\qtbase\bin\qmake.exe -install qinstall D:\QTCompile\Static\src\qt-everywhere-src-5.15.2\qtbase\mkspecs\modules-inst\qt_plugin_qdirect2d.pri D:\QTCompile\Static\5.15.2\mkspecs\modules\qt_plugin_qdirect2d.pri D:\QTCompile\Static\src\qt-everywhere-src-5.15.2\qtbase\bin\qmake.exe -install sed -e "s,D:/QTCompile/Static/src/qt-everywhere-src-5.15.2/[^/][^/]*/lib,$$[QT_INSTALL_LIBS],g" -e "s,D:\\\\QTCompile\\\\Static\\\\src\\\\qt-everywhere-src-5.15.2\\\\[^\\\\][^\\\\]*\\\\lib,$$[QT_INSTALL_LIBS],gi" -e "s,D:/QTCompile/Static/5.15.2/lib,$$[QT_INSTALL_LIBS],g" -e "s,D:\\\\QTCompile\\\\Static\\\\5.15.2\\\\lib,$$[QT_INSTALL_LIBS],gi" ..\..\..\..\plugins\platforms\qdirect2d.prl > D:\QTCompile\Static\5.15.2\plugins\platforms\qdirect2d.prl D:\QTCompile\Static\src\qt-everywhere-src-5.15.2\qtbase\bin\qmake.exe -install qinstall D:\QTCompile\Static\src\qt-everywhere-src-5.15.2\qtbase\lib\cmake\Qt5Gui\Qt5Gui_QWindowsDirect2DIntegrationPlugin.cmake D:\QTCompile\Static\5.15.2\lib\cmake\Qt5Gui\Qt5Gui_QWindowsDirect2DIntegrationPlugin.cmake D:\QTCompile\Static\src\qt-everywhere-src-5.15.2\qtbase\bin\qmake.exe -install qinstall D:\QTCompile\Static\src\qt-everywhere-src-5.15.2\qtbase\lib\cmake\Qt5Gui\Qt5Gui_QWindowsDirect2DIntegrationPlugin_Import.cpp D:\QTCompile\Static\5.15.2\lib\cmake\Qt5Gui\Qt5Gui_QWindowsDirect2DIntegrationPlugin_Import.cpp copy /y ..\..\..\..\plugins\platforms\libqdirect2d.a D:\QTCompile\Static\5.15.2\plugins\platforms\libqdirect2d.a 1 file(s) copied. mingw32-make[6]: Leaving directory 'D:/QTCompile/Static/src/qt-everywhere-src-5.15.2/qtbase/src/plugins/platforms/direct2d' mingw32-make[5]: Leaving directory 'D:/QTCompile/Static/src/qt-everywhere-src-5.15.2/qtbase/src/plugins/platforms/direct2d' mingw32-make[4]: Leaving directory 'D:/QTCompile/Static/src/qt-everywhere-src-5.15.2/qtbase/src/plugins/platforms' mingw32-make[3]: Leaving directory 'D:/QTCompile/Static/src/qt-everywhere-src-5.15.2/qtbase/src/plugins' mingw32-make[2]: Leaving directory 'D:/QTCompile/Static/src/qt-everywhere-src-5.15.2/qtbase/src' mingw32-make[1]: Leaving directory 'D:/QTCompile/Static/src/qt-everywhere-src-5.15.2/qtbase' mingw32-make: *** [Makefile:103: module-qtbase-install_subtargets] Error 2
-
When you would post the error message we can maybe help.
-
It's not an issue I dropped it and after 30+ times of recompiling QT, recompiling it on windows without the -j parameter worked.