Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Installation and Deployment
  4. Cannot build MySQL plugin for Windows in QT6.11
Qt 6.11 is out! See what's new in the release blog

Cannot build MySQL plugin for Windows in QT6.11

Scheduled Pinned Locked Moved Unsolved Installation and Deployment
4 Posts 3 Posters 351 Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • J Offline
    J Offline
    jrissole
    wrote on last edited by
    #1

    Yet another Qt version released and the MySQL plugin needs to be built again. There has never been a problem with the earlier versions but for 6.11 cmake fails:

    [cmake] Running C:\Program Files\CMake\bin\cmake.exe -S C:/Qt/6.11.0/Src/qtbase/src/plugins/sqldrivers -B D:/C/qt/build-sqldrivers/6.11.0/llvm-mingw_64 in D:\C\qt\build-sqldrivers\6.11.0\llvm-mingw_64.
    [cmake] CMake Error at C:/Qt/6.11.0/llvm-mingw_64/lib/cmake/Qt6/QtTargetHelpers.cmake:691 (add_library):
    [cmake] add_library cannot create ALIAS target "Qt6::QODBCDriverPlugin" because
    [cmake] another target with the same name already exists.
    [cmake] Call Stack (most recent call first):
    [cmake] C:/Qt/6.11.0/llvm-mingw_64/lib/cmake/Qt6/QtPluginHelpers.cmake:168 (qt_internal_add_target_aliases)
    [cmake] odbc/CMakeLists.txt:10 (qt_internal_add_plugin)

    Does anyone have any ideas?

    jsulmJ 1 Reply Last reply
    0
    • J jrissole

      Yet another Qt version released and the MySQL plugin needs to be built again. There has never been a problem with the earlier versions but for 6.11 cmake fails:

      [cmake] Running C:\Program Files\CMake\bin\cmake.exe -S C:/Qt/6.11.0/Src/qtbase/src/plugins/sqldrivers -B D:/C/qt/build-sqldrivers/6.11.0/llvm-mingw_64 in D:\C\qt\build-sqldrivers\6.11.0\llvm-mingw_64.
      [cmake] CMake Error at C:/Qt/6.11.0/llvm-mingw_64/lib/cmake/Qt6/QtTargetHelpers.cmake:691 (add_library):
      [cmake] add_library cannot create ALIAS target "Qt6::QODBCDriverPlugin" because
      [cmake] another target with the same name already exists.
      [cmake] Call Stack (most recent call first):
      [cmake] C:/Qt/6.11.0/llvm-mingw_64/lib/cmake/Qt6/QtPluginHelpers.cmake:168 (qt_internal_add_target_aliases)
      [cmake] odbc/CMakeLists.txt:10 (qt_internal_add_plugin)

      Does anyone have any ideas?

      jsulmJ Online
      jsulmJ Online
      jsulm
      Lifetime Qt Champion
      wrote on last edited by
      #2

      @jrissole Looks like you're building all SQL plug-ins, not just MySQL?

      https://forum.qt.io/topic/113070/qt-code-of-conduct

      1 Reply Last reply
      0
      • J Offline
        J Offline
        jrissole
        wrote on last edited by
        #3

        This is using C:\Qt\6.11.0\Src\qtbase\src\plugins\sqldrivers\CMakeLists.txt as the project (which is the way I have done it for previous versions 6.9 to 6.10.2). If you try and use C:\Qt\6.11.0\Src\qtbase\src\plugins\sqldrivers\mysql\CMakeLists.txt as the project you get:
        [cmake] Running C:\Qt\Tools\CMake_64\bin\cmake.exe -S C:/Qt/6.11.0/Src/qtbase/src/plugins/sqldrivers/mysql -B C:/Qt/6.11.0/Src/qtbase/src/plugins/sqldrivers/mysql/build/Desktop_Qt_6_11_0_llvm_mingw_64_bit-Debug "-DCMAKE_BUILD_TYPE:STRING=Debug" "-DCMAKE_PREFIX_PATH:PATH=C:/Qt/6.11.0/llvm-mingw_64" "-DCMAKE_CXX_COMPILER:FILEPATH=C:/Qt/Tools/llvm-mingw1706_64/bin/clang++.exe" "-DCMAKE_PROJECT_INCLUDE_BEFORE:FILEPATH=C:\Qt\6.11.0\Src\qtbase\src\plugins\sqldrivers\mysql\build\Desktop_Qt_6_11_0_llvm_mingw_64_bit-Debug/.qtc/package-manager/auto-setup.cmake" "-DCMAKE_COLOR_DIAGNOSTICS:BOOL=ON" "-DCMAKE_C_COMPILER:FILEPATH=C:/Qt/Tools/llvm-mingw1706_64/bin/clang.exe" "-DQT_MAINTENANCE_TOOL:FILEPATH=C:/Qt/MaintenanceTool.exe" "-DCMAKE_CXX_FLAGS_INIT:STRING=-DQT_QML_DEBUG" "-DCMAKE_GENERATOR:STRING=Ninja" "-DQT_QMAKE_EXECUTABLE:FILEPATH=C:/Qt/6.11.0/llvm-mingw_64/bin/qmake.exe" in C:\Qt\6.11.0\Src\qtbase\src\plugins\sqldrivers\mysql\build\Desktop_Qt_6_11_0_llvm_mingw_64_bit-Debug.
        [cmake] CMake Warning (dev) in CMakeLists.txt:
        [cmake] No project() command is present. The top-level CMakeLists.txt file must
        [cmake] contain a literal, direct call to the project() command. Add a line of
        [cmake] code such as
        [cmake]
        [cmake] project(ProjectName)
        [cmake]
        [cmake] near the top of the file, but after cmake_minimum_required().
        [cmake]
        [cmake] CMake is pretending there is a "project(Project)" command on the first
        [cmake] line.
        [cmake] This warning is for project developers. Use -Wno-dev to suppress it.
        [cmake]
        [cmake] CMake Warning (dev) in CMakeLists.txt:
        [cmake] cmake_minimum_required() should be called prior to this top-level project()
        [cmake] call. Please see the cmake-commands(7) manual for usage documentation of
        [cmake] both commands.
        [cmake] This warning is for project developers. Use -Wno-dev to suppress it.
        [cmake]
        [cmake] -- The C compiler identification is Clang 17.0.6
        [cmake] -- The CXX compiler identification is Clang 17.0.6
        [cmake] -- Detecting C compiler ABI info
        [cmake] -- Detecting C compiler ABI info - done
        [cmake] -- Check for working C compiler: C:/Qt/Tools/llvm-mingw1706_64/bin/clang.exe - skipped
        [cmake] -- Detecting C compile features
        [cmake] -- Detecting C compile features - done
        [cmake] -- Detecting CXX compiler ABI info
        [cmake] -- Detecting CXX compiler ABI info - done
        [cmake] -- Check for working CXX compiler: C:/Qt/Tools/llvm-mingw1706_64/bin/clang++.exe - skipped
        [cmake] -- Detecting CXX compile features
        [cmake] -- Detecting CXX compile features - done
        [cmake] CMake Error at CMakeLists.txt:8 (qt_internal_add_plugin):
        [cmake] Unknown CMake command "qt_internal_add_plugin".
        [cmake]
        [cmake]
        [cmake] CMake Warning (dev) in CMakeLists.txt:
        [cmake] No cmake_minimum_required command is present. A line of code such as
        [cmake]
        [cmake] cmake_minimum_required(VERSION 3.30)
        [cmake]
        [cmake] should be added at the top of the file. The version specified may be lower
        [cmake] if you wish to support older CMake versions for this project. For more
        [cmake] information run "cmake --help-policy CMP0000".
        [cmake] This warning is for project developers. Use -Wno-dev to suppress it.
        [cmake]
        [cmake] -- Configuring incomplete, errors occurred!
        [cmake]
        [cmake] The command "C:\Qt\Tools\CMake_64\bin\cmake.exe -S C:/Qt/6.11.0/Src/qtbase/src/plugins/sqldrivers/mysql -B C:/Qt/6.11.0/Src/qtbase/src/plugins/sqldrivers/mysql/build/Desktop_Qt_6_11_0_llvm_mingw_64_bit-Debug "-DCMAKE_BUILD_TYPE:STRING=Debug" "-DCMAKE_PREFIX_PATH:PATH=C:/Qt/6.11.0/llvm-mingw_64" "-DCMAKE_CXX_COMPILER:FILEPATH=C:/Qt/Tools/llvm-mingw1706_64/bin/clang++.exe" "-DCMAKE_PROJECT_INCLUDE_BEFORE:FILEPATH=C:\Qt\6.11.0\Src\qtbase\src\plugins\sqldrivers\mysql\build\Desktop_Qt_6_11_0_llvm_mingw_64_bit-Debug/.qtc/package-manager/auto-setup.cmake" "-DCMAKE_COLOR_DIAGNOSTICS:BOOL=ON" "-DCMAKE_C_COMPILER:FILEPATH=C:/Qt/Tools/llvm-mingw1706_64/bin/clang.exe" "-DQT_MAINTENANCE_TOOL:FILEPATH=C:/Qt/MaintenanceTool.exe" "-DCMAKE_CXX_FLAGS_INIT:STRING=-DQT_QML_DEBUG" "-DCMAKE_GENERATOR:STRING=Ninja" "-DQT_QMAKE_EXECUTABLE:FILEPATH=C:/Qt/6.11.0/llvm-mingw_64/bin/qmake.exe"" terminated with exit code 1.
        [cmake]
        [cmake] Elapsed time: 00:03.

        1 Reply Last reply
        0
        • Christian EhrlicherC Offline
          Christian EhrlicherC Offline
          Christian Ehrlicher
          Lifetime Qt Champion
          wrote on last edited by
          #4

          Looks like a bug, I've reported it here: https://qt-project.atlassian.net/browse/QTBUG-145563

          Qt Online Installer direct download: https://download.qt.io/official_releases/online_installers/
          Visit the Qt Academy at https://academy.qt.io/catalog

          1 Reply Last reply
          0
          • Christian EhrlicherC Christian Ehrlicher referenced this topic

          • Login

          • Login or register to search.
          • First post
            Last post
          0
          • Categories
          • Recent
          • Tags
          • Popular
          • Users
          • Groups
          • Search
          • Get Qt Extensions
          • Unsolved