Solved build GammaRay error on windows10 with MinGW
-
Hi,I want to build GammaRay from source on windows with MinGW;
when execute mingw32-make command I get the error below:D:\GammaRay\build>mingw32-make Scanning dependencies of target gammaray_kitemmodels_autogen [ 0%] Automatic MOC, UIC and RCC for target gammaray_kitemmodels [ 0%] Built target gammaray_kitemmodels_autogen Scanning dependencies of target gammaray_kitemmodels [ 1%] Building CXX object 3rdparty/kde/CMakeFiles/gammaray_kitemmodels.dir/klinkitemselectionmodel.cpp.obj [ 1%] Building CXX object 3rdparty/kde/CMakeFiles/gammaray_kitemmodels.dir/kmodelindexproxymapper.cpp.obj [ 1%] Building CXX object 3rdparty/kde/CMakeFiles/gammaray_kitemmodels.dir/krecursivefilterproxymodel.cpp.obj [ 1%] Building CXX object 3rdparty/kde/CMakeFiles/gammaray_kitemmodels.dir/kitemmodels_debug.cpp.obj [ 1%] Building CXX object 3rdparty/kde/CMakeFiles/gammaray_kitemmodels.dir/gammaray_kitemmodels_autogen/mocs_compilation.cpp.obj [ 1%] Linking CXX shared library ..\..\bin\libgammaray_kitemmodels-qt5_12-GNU-i686.dll CMakeFiles\gammaray_kitemmodels.dir/objects.a(klinkitemselectionmodel.cpp.obj):klinkitemselectionmodel.cpp:(.text+0x18): undefined reference to `_imp___ZN19QItemSelectionModelD2Ev' CMakeFiles\gammaray_kitemmodels.dir/objects.a(klinkitemselectionmodel.cpp.obj):klinkitemselectionmodel.cpp:(.text+0x4b): undefined reference to `_imp___ZN19QItemSelectionModelD2Ev' CMakeFiles\gammaray_kitemmodels.dir/objects.a(klinkitemselectionmodel.cpp.obj):klinkitemselectionmodel.cpp:(.text+0x6b): undefined reference to `_imp___ZNK11QObjectData17dynamicMetaObjectEv' CMakeFiles\gammaray_kitemmodels.dir/objects.a(klinkitemselectionmodel.cpp.obj):klinkitemselectionmodel.cpp:(.text+0xa0): undefined reference to `_imp___ZN11QMetaObject8activateEP7QObjectPKS_iPPv' CMakeFiles\gammaray_kitemmodels.dir/objects.a(klinkitemselectionmodel.cpp.obj):klinkitemselectionmodel.cpp:(.text+0x110): undefined reference to `_imp___ZN19QItemSelectionModelC2EP18QAbstractItemModelP7QObject' CMakeFiles\gammaray_kitemmodels.dir/objects.a(klinkitemselectionmodel.cpp.obj):klinkitemselectionmodel.cpp:(.text+0x152): undefined reference to `_imp___ZN19QItemSelectionModel14currentChangedERK11QModelIndexS2_' CMakeFiles\gammaray_kitemmodels.dir/objects.a(klinkitemselectionmodel.cpp.obj):klinkitemselectionmodel.cpp:(.text+0x17e): undefined reference to `_imp___ZN19QItemSelectionModel16staticMetaObjectE' CMakeFiles\gammaray_kitemmodels.dir/objects.a(klinkitemselectionmodel.cpp.obj):klinkitemselectionmodel.cpp:(.text+0x18c): undefined reference to `_imp___ZN7QObject11connectImplEPKS_PPvS1_S3_PN9QtPrivate15QSlotObjectBaseEN2Qt14ConnectionTypeEPKiPK11QMetaObject' CMakeFiles\gammaray_kitemmodels.dir/objects.a(klinkitemselectionmodel.cpp.obj):klinkitemselectionmodel.cpp:(.text+0x1e4): undefined reference to `_imp___ZN11QMetaObject10ConnectionD1Ev' CMakeFiles\gammaray_kitemmodels.dir/objects.a(klinkitemselectionmodel.cpp.obj):klinkitemselectionmodel.cpp:(.text+0x1fc): undefined reference to `_imp___ZN19QItemSelectionModel12modelChangedEP18QAbstractItemModel' CMakeFiles\gammaray_kitemmodels.dir/objects.a(klinkitemselectionmodel.cpp.obj):klinkitemselectionmodel.cpp:(.text+0x226): undefined reference to `_imp___ZN19QItemSelectionModel16staticMetaObjectE' CMakeFiles\gammaray_kitemmodels.dir/objects.a(klinkitemselectionmodel.cpp.obj):klinkitemselectionmodel.cpp:(.text+0x2e0): undefined reference to `_imp___ZN19QItemSelectionModelD2Ev'
what is the error? How to resolve it?
thank you! -
@sz_y Please don't double post same question!
Duplicate of https://forum.qt.io/topic/109494/gammaray-build-error-on-windows10-with-microsoft-visual-studio -
@jsulm it is not the same question with "https://forum.qt.io/topic/109494/gammaray-build-error-on-windows10-with-microsoft-visual-studio";
one is windows10 with MinGW and the other is windows10 with Mirosoft-visual-studio; -
can you show us the cmake call and its output?
-
@VRonin
Thank you!
The cmake call and its output is as follow:D:\GammaRay>mkdir build D:\GammaRay>cd build D:\GammaRay\build>cmake -G "MinGW Makefiles" .. -- The CXX compiler identification is GNU 4.9.2 -- The C compiler identification is GNU 4.9.2 -- Check for working CXX compiler: C:/Strawberry/c/bin/g++.exe -- Check for working CXX compiler: C:/Strawberry/c/bin/g++.exe -- works -- Detecting CXX compiler ABI info -- Detecting CXX compiler ABI info - done -- Detecting CXX compile features -- Detecting CXX compile features - done -- Check for working C compiler: C:/Strawberry/c/bin/gcc.exe -- Check for working C compiler: C:/Strawberry/c/bin/gcc.exe -- works -- Detecting C compiler ABI info -- Detecting C compiler ABI info - done -- Detecting C compile features -- Detecting C compile features - done -- Could NOT find libdw (missing: LIBDW_LIBRARY LIBDW_INCLUDE_DIR) -- Could NOT find libbfd (missing: LIBDL_LIBRARY LIBDL_INCLUDE_DIR) -- BACKWARD_HAS_UNWIND=1 -- BACKWARD_HAS_BACKTRACE=0 -- BACKWARD_HAS_BACKTRACE_SYMBOL=1 -- BACKWARD_HAS_DW=0 -- BACKWARD_HAS_BFD=0 -- Could NOT find Git (missing: GIT_EXECUTABLE) -- Building GammaRay 2.11.50 in Release mode -- Performing Test C_SUPPORTS_UNUSED_BUT_SET -- Performing Test C_SUPPORTS_UNUSED_BUT_SET - Success -- Performing Test CXX_SUPPORTS_UNUSED_BUT_SET -- Performing Test CXX_SUPPORTS_UNUSED_BUT_SET - Success -- Performing Test C_SUPPORTS_LOGICAL_OP -- Performing Test C_SUPPORTS_LOGICAL_OP - Success -- Performing Test CXX_SUPPORTS_LOGICAL_OP -- Performing Test CXX_SUPPORTS_LOGICAL_OP - Success -- Performing Test C_SUPPORTS_POINTER_MEMACCESS -- Performing Test C_SUPPORTS_POINTER_MEMACCESS - Success -- Performing Test CXX_SUPPORTS_POINTER_MEMACCESS -- Performing Test CXX_SUPPORTS_POINTER_MEMACCESS - Success -- Performing Test C_SUPPORTS_REORDER -- Performing Test C_SUPPORTS_REORDER - Failed -- Performing Test CXX_SUPPORTS_REORDER -- Performing Test CXX_SUPPORTS_REORDER - Success -- Performing Test C_SUPPORTS_FORMAT_SECURITY -- Performing Test C_SUPPORTS_FORMAT_SECURITY - Failed -- Performing Test CXX_SUPPORTS_FORMAT_SECURITY -- Performing Test CXX_SUPPORTS_FORMAT_SECURITY - Failed -- Performing Test HAVE_GXX_GNUXX11 -- Performing Test HAVE_GXX_GNUXX11 - Success -- Performing Test HAVE_GXX_CXX11 -- Performing Test HAVE_GXX_CXX11 - Success -- Performing Test C_SUPPORTS_ZERO_AS_NULL_POINTER_CONSTANT -- Performing Test C_SUPPORTS_ZERO_AS_NULL_POINTER_CONSTANT - Failed -- Performing Test CXX_SUPPORTS_ZERO_AS_NULL_POINTER_CONSTANT -- Performing Test CXX_SUPPORTS_ZERO_AS_NULL_POINTER_CONSTANT - Success -- Checking whether private include directories for module Core exist -- Checking whether private include directories for module Gui exist -- Checking whether private include directories for module Widgets exist -- Checking whether private include directories for module Qml exist -- Checking whether private include directories for module Quick exist -- Checking whether private include directories for module Scxml exist -- Looking for QT_NO_OPENGL -- Looking for QT_NO_OPENGL - not found -- Looking for QT_NO_PRINTER -- Looking for QT_NO_PRINTER - not found -- Looking for include file stdint.h -- Looking for include file stdint.h - found -- Looking for include file unistd.h -- Looking for include file unistd.h - found -- Looking for backtrace -- Looking for backtrace - not found -- Looking for abi::__cxa_demangle -- Looking for abi::__cxa_demangle - found -- Building probe for ABI: qt5_12-GNU-i686 (Release) -- Performing Test COMPILER_HAS_DEPRECATED_ATTR -- Performing Test COMPILER_HAS_DEPRECATED_ATTR - Success -- Performing Test HAVE_NO_CXX_ZERO_AS_NULL_POINTER_CON -- Performing Test HAVE_NO_CXX_ZERO_AS_NULL_POINTER_CON - Success -- Performing Test HAVE_NO_CXX_UNNEEDED_INTERNAL_DEC -- Performing Test HAVE_NO_CXX_UNNEEDED_INTERNAL_DEC - Success -- Performing Test HAVE_NO_CXX_NULL_CONVERSION -- Performing Test HAVE_NO_CXX_NULL_CONVERSION - Success -- Performing Test CAN_LINK_GUI_GLESV2 -- Performing Test CAN_LINK_GUI_GLESV2 - Failed -- Could NOT find VTK (missing: VTK_DIR) -- Found PkgConfig: C:/Strawberry/perl/bin/pkg-config (found version "") -- Could NOT find Wayland_Server (missing: Wayland_Server_LIBRARY Wayland_Server_INCLUDE_DIR) (found version "") -- Could NOT find Wayland (missing: Wayland_LIBRARIES Server) (Required is at least version "1.12") -- Could NOT find Doxygen (missing: DOXYGEN_EXECUTABLE) -- Unable to provide inheritance diagrams for the API documentation. To fix, install the graphviz project from https://www.graphviz.org -- The following features have been enabled: * Option GAMMARAY_BUILD_UI, Build the GammaRay client and in-process UI. * Option GAMMARAY_MULTI_BUILD, Build multiple applicable probe configurations. * Option GAMMARAY_BUILD_CLI_INJECTOR, Build command line injector on Windows. * Option GAMMARAY_BUILD_DOCS, Build GammaRay documentation. * QtScript debugger, Requires QtScript and QtScriptTools. * Widget .ui file export, Requires QtDesigner library. * 3D Widget Inspector, Requires Qt5 >= 5.7, Qt3D and QtQuick Controls * User Manual creation in qch format, Requires qdoc, qhelpgenerator, qtattributionsscanner, the qdoc templates and index files -- The following OPTIONAL packages have been found: * Qt53DCore (required version >= 5.12.3) * Qt53DAnimation * Qt5Gamepad (required version >= 5.12.3) * Qt53DExtras * Qt53DInput * Qt53DLogic * Qt53DRender * Qt53DQuick * Qt5Bluetooth * Qt5UiPlugin (required version >= 5.12.3) * Qt5Xml (required version >= 5.12.3) * Qt5Designer * Qt5PositioningQuick (required version >= 5.12.3) * Qt5Location * Qt5Positioning * Qt5PrintSupport Required for widget PDF export. * Qt5Qml * Qt5Quick * Qt5QuickWidgets * Qt5Svg Required for widget SVG export. * Qt5Script * Qt5ScriptTools * Qt5Test * Qt5Scxml (required version >= 5.8) * Qt5Sql (required version >= 5.12.3) * Qt5Help * Qt5LinguistTools * PkgConfig -- The following RECOMMENDED packages have been found: * Qt5Concurrent Required for the GammaRay launcher process list. -- The following REQUIRED packages have been found: * Qt5Core (required version >= 5.5) * Qt5Gui * Qt5Network * Qt5Widgets * Qt5, <https://qt.io/> -- The following features have been disabled: * Option GAMMARAY_PROBE_ONLY_BUILD, Build only an additional probe configuration for an already existing launcher. * Option GAMMARAY_CLIENT_ONLY_BUILD, Build the client part only. * Option GAMMARAY_ENABLE_GPL_ONLY_FEATURES, Enable features only available under GPL license. * Option GAMMARAY_INSTALL_QT_LAYOUT, Install into Qt directory layout. * Option GAMMARAY_STATIC_PROBE, Build the probe as static library for compile-time injection. * Option GAMMARAY_ENFORCE_QT_ASSERTS, Force QT_ASSERT in all builds. * Option GAMMARAY_DISABLE_FEEDBACK, Disable user feedback support. * Option GAMMARAY_CORE_ONLY_LAUNCHER, Only use QtCore in the CLI launcher (breaks style injector, but is needed for Boot2Qt compatibility) * ELF ABI detection, Automatic probe ABI detection on ELF-based systems. Requires elf.h. -- The following OPTIONAL packages have not been found: * Git Determine exact build version. * Qt5AndroidExtras * Qt5WebEngineWidgets * Qt5WaylandCompositor * Qt5IviCore (required version >= 1.1) * Qt5IviVehicleFunctions (required version >= 1.1) * Qt5IviMedia (required version >= 1.1) * Glslang, <https://github.com/KhronosGroup/glslang> Validate GL shader code. * QmlLint, <https://qt.io> Validate QML code. * KF5CoreAddons, KDE KCoreAddons Framework, <https://www.kde.org/> Required for the KJob tracker plug-in. * VTK (required version >= 7.1), Visualization Toolkit, <https://www.vtk.org> Needed for the object visualizer plugin (required Qt5). Just for toying around, highly experimental plugin. * Wayland (required version >= 1.12), C library implementation of the Wayland protocol: a protocol for a compositor to talk to its clients, <http://wayland.freedesktop.org> Needed for the QtWayland compositor inspector plug-in. * Doxygen, API Documentation system, <http://www.doxygen.org> Needed to build the API documentation. -- The following RECOMMENDED packages have not been found: * KF5SyntaxHighlighting (required version >= 5.28), <https://www.kde.org/> Syntax highlighting for code editor. * KDSME (required version >= 1.2), KDAB State Machine Editor framework, <https://github.com/KDAB/KDStateMachineEditor> Graphical state machine debugging. -- Configuring done -- Generating done -- Build files have been written to: D:/GammaRay/build
-
I just tried and it builds fine for me.
make sure you run qtenv2.bat (you can find it somwhere like C:\Qt\5.13.2\mingw73_64\bin\qtenv2.bat) before calling cmake on the command line -
@VRonin Thank you very much.
I have builed sucessfully followed your sugestion.
But,I have meet other problems as below:
After the commiand line "mingw32-make install" complete, I can find the executed program of gammaray in the path "C:\Program Files (x86)\GammaRay\bin".Howevery,I cann't find it in start menu; I must run it
by command line and make sure had run qtenv2.bat before run gammaray. -
@sz_y said in build GammaRay error on windows10 with MinGW:
I cann't find it in start menu
This is something an installer does. Without installer you will need to do it by yourself.
-
@sz_y said in build GammaRay error on windows10 with MinGW:
I cann't find it in start menu;
Just create a shortcut to
C:\Program Files (x86)\GammaRay\bin\gammaray-launcher.exe
into%AppData%\Microsoft\Windows\Start Menu\Programs
I must run it by command line and make sure had run qtenv2.bat before run gammaray.
No but
make install
usually doesn't deploy the dependencies. If you try to startgammaray-launcher.exe
it will tell you there are some dlls missing but you can copy them to the folder from either the Qt bin folder or the mingw folder. The only thing that is not straightforward is the platform plugin: create a subfolder insideC:\Program Files (x86)\GammaRay\bin
and call itplatforms
then copy in there theqwindows.dll
that you can find in the Qt folder\plugins\platforms
-
@VRonin Thank you very much!
I have copy the dll file to GammaRay\bin.
But ,when I run gammaray D:\qt_demo\build-123-Desktop_Qt_5_12_3_MinGW_64_bit-Release\release\123.exe I get the followed
information:
Detected ABI qt5_12-GNU-x86_64, using ABI qt5_12-GNU-x86_64. -
@VRonin said in build GammaRay error on windows10 with MinGW:
ust create a shortcut to C:\Program Files (x86)\GammaRay\bin\gammaray-launcher.exe into %AppData%\Microsoft\Windows\Start Menu\Programs
Thank you !
I have create a shortcut following your suggestion. -
@VRonin said in build GammaRay error on windows10 with MinGW:
I must run it by command line and make sure had run qtenv2.bat before run gammaray.
I also resolve this problem by add C:\Qt\Qt5.12.3\5.12.3\mingw73_64\bin in the system varialble of path.
Thank you! -
@sz_y said in build GammaRay error on windows10 with MinGW:
add C:\Qt\Qt5.12.3\5.12.3\mingw73_64\bin in the system varialble of path
This is not a great solution. If you change Qt Version, compiler or architecture you end up in a pickle