Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. Problems building mysql plugin on Windows for Qt 6.1.2

Problems building mysql plugin on Windows for Qt 6.1.2

Scheduled Pinned Locked Moved Solved General and Desktop
13 Posts 5 Posters 819 Views 3 Watching
  • 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.
  • M Offline
    M Offline
    Marcusdrl
    wrote on last edited by
    #1

    Hi, im having a hard time trying to build the mysql plugin for qt... first thing i tried was to follow the documentation https://doc.qt.io/qt-5/sql-driver.html , the problem starts with my prompt input (i've tried to use qt msvc command line, vcvarsall etc...):

    qmake -- MYSQL_INCDIR="C:\Program Files\MySQL\MySQL Server 8.0\include" MYSQL_LIBDIR="C:\Program Files\MySQL\MySQL Server 8.0\lib"
    

    This qmake line gives me exactly nothing as an error it just doesnt execute and instead it links all the options available for qmake (like a -help).

    nmake sub-mysql
    nmake install
    

    And these 2 lines above just give an error saying that nmake doesnt know how to create: 'sub-mysql' and 'install'.

    I just dont know what to do from now on, any help is appreaciated.
    Thanks in advance.

    Obs: i've already tried reinstalling qt and downloading resources directly from github. What i noticed reading some post about similar problems was people mentioning mysql.pro and sqldrivers.pro and i dont have those in my qt 6.1.2/6.1.0 installed versions

    1 Reply Last reply
    0
    • M Offline
      M Offline
      mchinand
      wrote on last edited by
      #2

      Can you post what the output is from your qmake command? There may be some text explaining what it doesn't like in addition to listing all of its options.

      1 Reply Last reply
      1
      • mrjjM Offline
        mrjjM Offline
        mrjj
        Lifetime Qt Champion
        wrote on last edited by
        #3

        Hi
        Also for Qt 6, it seems to use configure.bat and not qmake
        https://doc.qt.io/qt-6/sql-driver.html

        1 Reply Last reply
        1
        • M Offline
          M Offline
          Marcusdrl
          wrote on last edited by
          #4

          Hello guys, thank you for your time, as @mrjj said i just noticed that i was using the wrong documentation and tried to build it with the configure.bat and now i got the following errors:

          D:\Qt\6.1.2\Src>configure.bat -sql-mysql -- -DCMAKE_INCLUDE_PATH="C:\Program Files\MySQL\MySQL Server 8.0\include" -DCMAKE_LIBRARY_PATH="C:\Program Files\MySQL\MySQL Server 8.0\lib"
          + cd qtbase
          + D:\Qt\6.1.2\Src\qtbase\configure.bat -top-level -sql-mysql -- -DCMAKE_INCLUDE_PATH="C:\Program Files\MySQL\MySQL Server 8.0\include" -DCMAKE_LIBRARY_PATH="C:\Program Files\MySQL\MySQL Server 8.0\lib"
          'C:/Program Files/CMake/bin/cmake.exe' '-DCMAKE_INCLUDE_PATH=C:\Program Files\MySQL\MySQL Server 8.0\include' '-DCMAKE_LIBRARY_PATH=C:\Program Files\MySQL\MySQL Server 8.0\lib' '-DINPUT_sql_mysql=yes' '-G' 'Ninja' 'D:/Qt/6.1.2/Src'
          -- The CXX compiler identification is MSVC 19.29.30038.1
          -- The C compiler identification is MSVC 19.29.30038.1
          -- The ASM compiler identification is MSVC
          -- Found assembler: D:/VisualStudio2019/VC/Tools/MSVC/14.29.30037/bin/Hostx64/x64/cl.exe
          -- Detecting CXX compiler ABI info
          -- Detecting CXX compiler ABI info - failed
          -- Check for working CXX compiler: D:/VisualStudio2019/VC/Tools/MSVC/14.29.30037/bin/Hostx64/x64/cl.exe
          -- Check for working CXX compiler: D:/VisualStudio2019/VC/Tools/MSVC/14.29.30037/bin/Hostx64/x64/cl.exe - broken
          CMake Error at C:/Program Files/CMake/share/cmake-3.21/Modules/CMakeTestCXXCompiler.cmake:62 (message):
            The C++ compiler
          
              "D:/VisualStudio2019/VC/Tools/MSVC/14.29.30037/bin/Hostx64/x64/cl.exe"
          
            is not able to compile a simple test program.
          
            It fails with the following output:
          
              Change Dir: D:/Qt/6.1.2/Src/CMakeFiles/CMakeTmp
          
              Run Build Command(s):C:/Ninja/ninja.exe cmTC_2283f && [1/2] Building CXX object CMakeFiles\cmTC_2283f.dir\testCXXCompiler.cxx.obj
              [2/2] Linking CXX executable cmTC_2283f.exe
              FAILED: cmTC_2283f.exe
              cmd.exe /C "cd . && "C:\Program Files\CMake\bin\cmake.exe" -E vs_link_exe --intdir=CMakeFiles\cmTC_2283f.dir --rc=rc --mt=CMAKE_MT-NOTFOUND --manifests  -- D:\VisualStudio2019\VC\Tools\MSVC\14.29.30037\bin\Hostx64\x64\link.exe /nologo CMakeFiles\cmTC_2283f.dir\testCXXCompiler.cxx.obj  /out:cmTC_2283f.exe /implib:cmTC_2283f.lib /pdb:cmTC_2283f.pdb /version:0.0 /machine:x64  /debug /INCREMENTAL /subsystem:console  kernel32.lib user32.lib gdi32.lib winspool.lib shell32.lib ole32.lib oleaut32.lib uuid.lib comdlg32.lib advapi32.lib && cd ."
              RC Pass 1: command "rc /fo CMakeFiles\cmTC_2283f.dir/manifest.res CMakeFiles\cmTC_2283f.dir/manifest.rc" failed (exit code 0) with the following output:
              O sistema não pode encontrar o arquivo especificado
              ninja: build stopped: subcommand failed.
             -- Configuring incomplete, errors occurred!
          
          
          
          
          
            CMake will not be able to correctly generate this project.
          Call Stack (most recent call first):
            CMakeLists.txt:11 (project)
          
          
          See also "D:/Qt/6.1.2/Src/CMakeFiles/CMakeOutput.log".
          See also "D:/Qt/6.1.2/Src/CMakeFiles/CMakeError.log".
          CMake Error at qtbase/cmake/QtProcessConfigureArgs.cmake:828 (message):
            CMake exited with code 1.
          
          1 Reply Last reply
          0
          • M Offline
            M Offline
            Marcusdrl
            wrote on last edited by
            #5

            So... i figured out what the previous error was related to, but now i'm getting a Qt6config.cmake file error, this is what im getting from CMD:

            CMake Error at CMakeLists.txt:13 (find_package):
              Could not find a configuration file for package "Qt6" that is compatible
              with requested version "6.1.0".
            
              The following configuration files were considered but not accepted:
            
                D:/Qt/6.1.2/msvc2019_64/lib/cmake/Qt6/Qt6Config.cmake, version: 6.1.2 (64bit)
                D:/Qt/6.1.0/msvc2019_64/lib/cmake/Qt6/Qt6Config.cmake, version: 6.1.0 (64bit)
            

            Any ideas on whats happening?

            mrjjM 1 Reply Last reply
            0
            • M Marcusdrl

              So... i figured out what the previous error was related to, but now i'm getting a Qt6config.cmake file error, this is what im getting from CMD:

              CMake Error at CMakeLists.txt:13 (find_package):
                Could not find a configuration file for package "Qt6" that is compatible
                with requested version "6.1.0".
              
                The following configuration files were considered but not accepted:
              
                  D:/Qt/6.1.2/msvc2019_64/lib/cmake/Qt6/Qt6Config.cmake, version: 6.1.2 (64bit)
                  D:/Qt/6.1.0/msvc2019_64/lib/cmake/Qt6/Qt6Config.cmake, version: 6.1.0 (64bit)
              

              Any ideas on whats happening?

              mrjjM Offline
              mrjjM Offline
              mrjj
              Lifetime Qt Champion
              wrote on last edited by
              #6

              @Marcusdrl
              Hi
              Not really as im not sure why
              D:/Qt/6.1.0/msvc2019_64/lib/cmake/Qt6/Qt6Config.cmake, version: 6.1.0 (64bit)
              was not accepted as seems to match the version.

              Maybe if we are lucky Mr @Christian-Ehrlicher comes online soon as he is cmake expert if i ever saw one :)

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

                Are you sure you call it from the correct command prompt (64 bit msvc)?

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

                M 1 Reply Last reply
                1
                • Christian EhrlicherC Christian Ehrlicher

                  Are you sure you call it from the correct command prompt (64 bit msvc)?

                  M Offline
                  M Offline
                  Marcusdrl
                  wrote on last edited by
                  #8

                  @Christian-Ehrlicher i checked it, and i wasnt actually... now that i used it i got the same error above related to cl.exe:

                  -- Detecting CXX compiler ABI info - failed
                  -- Check for working CXX compiler: D:/VisualStudio2019/VC/Tools/MSVC/14.29.30037/bin/Hostx64/x64/cl.exe
                  -- Check for working CXX compiler: D:/VisualStudio2019/VC/Tools/MSVC/14.29.30037/bin/Hostx64/x64/cl.exe - broken
                  CMake Error at C:/Program Files/CMake/share/cmake-3.21/Modules/CMakeTestCXXCompiler.cmake:62 (message):
                    The C++ compiler
                  
                      "D:/VisualStudio2019/VC/Tools/MSVC/14.29.30037/bin/Hostx64/x64/cl.exe"
                  
                    is not able to compile a simple test program.
                  
                    It fails with the following output:
                  
                      Change Dir: D:/Qt/6.1.0/Src/qtbase/src/plugins/sqldrivers/build-sqldrivers/CMakeFiles/CMakeTmp
                  
                      Run Build Command(s):C:/Ninja/ninja.exe cmTC_a04d9 &&
                      CreateProcess failed. Command attempted:
                      "D:\VisualStudio2019\VC\Tools\MSVC\14.29.30037\bin\Hostx64\x64\cl.exe    -o CMakeFiles\cmTC_a04d9.dir\testCXXCompiler.cxx.obj -c D:\Qt\6.1.0\Src\qtbase\src\plugins\sqldrivers\build-sqldrivers\CMakeFiles\CMakeTmp\testCXXCompiler.cxx"
                      ninja: fatal: CreateProcess: A operaþÒo solicitada requer elevaþÒo.
                  
                  
                  
                  
                  
                  
                    CMake will not be able to correctly generate this project.
                  Call Stack (most recent call first):
                    CMakeLists.txt:7 (project)
                  
                  1 Reply Last reply
                  0
                  • M Offline
                    M Offline
                    Marcusdrl
                    wrote on last edited by
                    #9

                    @Christian-Ehrlicher So i finally got what happened, i had to give Admin acess to ninja and run my msvc x64 CMD as administrator too... now i finally have a build folder, but facing another problem, the documentation says that i have to execute these 2 lines after creating my Cmake files:

                    qt-cmake --build .
                    qt-cmake --install
                    

                    But these are giving me the following errors:

                    CMake Error: Unknown argument --build
                    CMake Error: Run 'cmake --help' for all supported options.
                    

                    Am i supposed to run cmake --build instead of qt-cmake?

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

                      Strange, it should work - it's a common parameter for cmake: https://cmake.org/cmake/help/latest/manual/cmake.1.html. But it basically calls ninja - so try simply executing ninja and then ninja install to compile and install the plugin

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

                      M 1 Reply Last reply
                      2
                      • Christian EhrlicherC Christian Ehrlicher

                        Strange, it should work - it's a common parameter for cmake: https://cmake.org/cmake/help/latest/manual/cmake.1.html. But it basically calls ninja - so try simply executing ninja and then ninja install to compile and install the plugin

                        M Offline
                        M Offline
                        Marcusdrl
                        wrote on last edited by Marcusdrl
                        #11

                        @Christian-Ehrlicher said in Problems building mysql plugin on Windows for Qt 6.1.2:

                        Strange, it should work - it's a common parameter for cmake: https://cmake.org/cmake/help/latest/manual/cmake.1.html. But it basically calls ninja - so try simply executing ninja and then ninja install to compile and install the plugin

                        Hi, the problem was actually that "NINJA" wasnt being called because it didnt had ADMINISTRATOR privileges. I got my problems solved just by simply giving adm privileges for MSVC CMD and NINJA, its kinda frustrating to think that i spent 2 whole days trying to figure out what was happening and it was something this simple... but yeah i have MySQL plugin installed and working now, ty for the replys.

                        Obs: qt-cmake calls didnt work except for the first line call (these below are my paths):

                        qt-cmake -G"Ninja" D:\Qt\6.1.2\Src\qtbase\src\plugins\sqldrivers -DCMAKE_INSTALL_PREFIX="D:\Qt\6.1.2\msvc2019_64" -DMySQL_INCLUDE_DIR="C:\Program Files\MySQL\MySQL Server 8.0\include" -DMySQL_LIBRARY="C:\Program Files\MySQL\MySQL Server 8.0\lib\libmysql.lib"
                        

                        And for the second part i had to call cmake --build . and cmake --install . instead of qt-cmake...it worked but i dont have any idea of why it did, since the documentation was specifying qt-cmake calls.

                        1 Reply Last reply
                        0
                        • SGaistS Offline
                          SGaistS Offline
                          SGaist
                          Lifetime Qt Champion
                          wrote on last edited by
                          #12

                          Hi,

                          That's a rather strange requirements. Do you have your files stored in some place that requires administration rights to be executed / written ?

                          Interested in AI ? www.idiap.ch
                          Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

                          M 1 Reply Last reply
                          1
                          • SGaistS SGaist

                            Hi,

                            That's a rather strange requirements. Do you have your files stored in some place that requires administration rights to be executed / written ?

                            M Offline
                            M Offline
                            Marcusdrl
                            wrote on last edited by Marcusdrl
                            #13

                            @SGaist Hi,
                            i made a few tests real quick and i noticed that my Program Files folder always ask for permission before executing an action, maybe thats it.

                            qt-cmake -G"Ninja" D:\Qt\6.1.2\Src\qtbase\src\plugins\sqldrivers -DCMAKE_INSTALL_PREFIX="D:\Qt\6.1.2\msvc2019_64" -DMySQL_INCLUDE_DIR="C:\Program Files\MySQL\MySQL Server 8.0\include" -DMySQL_LIBRARY="C:\Program Files\MySQL\MySQL Server 8.0\lib\libmysql.lib"
                            

                            In the line above i use the mysql installation folder to specify include and lib paths.

                            1 Reply Last reply
                            0

                            • Login

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