Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. International
  3. French
  4. Problème d'installation du driver QMySql
Forum Updated to NodeBB v4.3 + New Features

Problème d'installation du driver QMySql

Scheduled Pinned Locked Moved Solved French
27 Posts 3 Posters 4.8k 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.
  • hskoglundH Offline
    hskoglundH Offline
    hskoglund
    wrote on last edited by
    #15

    Hi, you still get the same error, most likely because of the cmake cache.
    Try nuking (erasing) the build directory sqldrivers in Users/melvin_vga/Qt/6.2.3/Src/qtbase/src/plugins/ (easiest might be to download the Qt 6.2.3 source again).

    1 Reply Last reply
    1
    • M Offline
      M Offline
      melvin_vga
      wrote on last edited by
      #16

      I uninstalled version 6.2.3 using the maintenance tool and I reinstalled it but it gives me the same errors after redoing the qtcmake and the build

      1 Reply Last reply
      0
      • hskoglundH Offline
        hskoglundH Offline
        hskoglund
        wrote on last edited by
        #17
        This post is deleted!
        1 Reply Last reply
        0
        • hskoglundH Offline
          hskoglundH Offline
          hskoglund
          wrote on last edited by hskoglund
          #18

          I think I've found the answer, first, while -DCMAKE_OSX_ARCHITECTURES=arm64 works fine for building the sqllite and odbc plugins, it does not work for mysql :-(

          Instead, you'll have to edit the link.txt command file manually.
          So new instructions are:

          1. Do the vanilla qt-cmake build command: /Users/melvin_vga/Qt/6.2.3/macos/bin/qt-cmake /Users/melvin_vga/Qt/6.2.3/Src/qtbase/src/plugins/sqldrivers -DCMAKE_INSTALL_PREFIX=/Users/melvin_vga/Qt/6.2.3/macos -DMySQL_INCLUDE_DIR="/usr/local/mysql/include" -DMySQL_LIBRARY="/usr/local/mysql/lib/libmysqlclient.dylib"
          1. Go into the directory /Users/melvin_vga/Qt/6.2.3/Src/qtbase/src/plugins/sqldrivers/mysql/CMakeFiles/QMYSQLDriverPlugin.dir and look for a file called link.txt
            it should consist of one line beginning with:
          /usr/bin/clang++ -g -DNDEBUG -O2 -arch x86_64 -isysroot /Applications/Xcode.app/Conten...
          

          change x86_64 to arm64 like so:

          /usr/bin/clang++ -g -DNDEBUG -O2 -arch arm64 -isysroot /Applications/Xcode.app/Conten...
          

          then try the cmake --build . again

          1 Reply Last reply
          1
          • M Offline
            M Offline
            melvin_vga
            wrote on last edited by
            #19

            I don't have a file name CMakeFiles in :

            /Users/melvin_vga/Qt/6.2.3/Src/qtbase/src/plugins/sqldrivers/mysql
            

            Screenshot 2022-03-15 at 20.32.50.png

            hskoglundH 1 Reply Last reply
            0
            • M melvin_vga

              I don't have a file name CMakeFiles in :

              /Users/melvin_vga/Qt/6.2.3/Src/qtbase/src/plugins/sqldrivers/mysql
              

              Screenshot 2022-03-15 at 20.32.50.png

              hskoglundH Offline
              hskoglundH Offline
              hskoglund
              wrote on last edited by hskoglund
              #20

              CMakeFiles is not a file, it's a subdirectory
              Note I edited my post above, I think it suffices that you edit the link.txt file

              1 Reply Last reply
              0
              • M Offline
                M Offline
                melvin_vga
                wrote on last edited by
                #21

                As you can see from the screenshot I posted above, I don't have the subdirectory named CMakeFiles in "mysql" and therefore not the link.txt in qt but it is in the build-sqldrivers after typing the command.

                I still tried to make the changes in the link.txt of build-sqldrivers with arm and this gives this build which seems normal to me since I did not make any changes in the QT folder :

                Screenshot 2022-03-15 at 23.01.40.png

                1 Reply Last reply
                0
                • hskoglundH Offline
                  hskoglundH Offline
                  hskoglund
                  wrote on last edited by
                  #22

                  Nice, now cmake does not complain about linking with Homebrew's MySQL client (link.txt is ok with "... -arch arm64...")

                  One final step: fixing the 3 .o files so that they are built for arm64 (and not x86_64):
                  Go to the same directory as when you edited the link.txt file:
                  /Users/melvin_vga/Qt/6.2.3/Src/qtbase/src/plugins/sqldrivers/mysql/CMakeFiles/QMYSQLDriverPlugin.dir and look for a file called flags.make
                  It should have 11 lines (the first one says "DO NOT EDIT" we will do it anyway :-)
                  The last line in the file should begin with:

                  CXX_FLAGS = -g -DNDEBUG -O2 -arch x86_64 -isysroot /Applications/Xcode.app/Conten...
                  

                  change x86_64 to arm64:

                  CXX_FLAGS = -g -DNDEBUG -O2 -arch arm64 -isysroot /Applications/Xcode.app/Conten...
                  

                  then try the cmake --build . again

                  1 Reply Last reply
                  1
                  • M Offline
                    M Offline
                    melvin_vga
                    wrote on last edited by
                    #23

                    Is this message good ?Screenshot 2022-03-16 at 10.37.32.png

                    1 Reply Last reply
                    0
                    • hskoglundH Offline
                      hskoglundH Offline
                      hskoglund
                      wrote on last edited by
                      #24

                      Yes looks good, you have the plugin built for arm64.
                      Now you need to copy it into your Qt 6.2.3 installation.
                      You have done that bedore, see the post above for using the find command in Terminal to see where the .dylib is, snd then copy it into yout Qt.

                      1 Reply Last reply
                      1
                      • M Offline
                        M Offline
                        melvin_vga
                        wrote on last edited by
                        #25

                        I need to install no ?

                        cmake --install .
                        
                        1 Reply Last reply
                        0
                        • M Offline
                          M Offline
                          melvin_vga
                          wrote on last edited by
                          #26

                          I don't have cmake install I just moved the build file into the qt file and it works perfectly! thank you very much!

                          1 Reply Last reply
                          0
                          • hskoglundH Offline
                            hskoglundH Offline
                            hskoglund
                            wrote on last edited by hskoglund
                            #27

                            Edit: Good! I made a post about copying but it was not needed :-)

                            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