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. Mysql drivers built but qt can not find them
Forum Updated to NodeBB v4.3 + New Features

Mysql drivers built but qt can not find them

Scheduled Pinned Locked Moved Unsolved General and Desktop
22 Posts 4 Posters 3.2k Views 1 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.
  • hskoglundH Online
    hskoglundH Online
    hskoglund
    wrote on last edited by
    #21

    Hi, found it: https://forum.qt.io/topic/136231/mysql-plugin-on-m1-mac/10

    Adding -DCMAKE_OSX_ARCHITECTURES="arm64" has not been sufficient for a looong time.

    The good news is that for Qt 6.7.0 it's slightly easier. Anyway there are two things that has be fixed: build with Nnja and manually edit the Ninja build file before issuing the cmake --build .

    So the qt-cmake command should be:
    ~/Qt/6.7.0/macos/bin/qt-cmake -GNinja -DMySQL_LIBRARY=/opt/homebrew/opt/mysql/lib/libmysqlclient.dylib -DMySQL_INCLUDE_DIR=/opt/homebrew/opt/mysql/include/mysql -DCMAKE_OSX_ARCHITECTURES="arm64" .

    Once it's done, do this magic command:

    sed -i -e 's/-arch x86_64/-arch arm64/g' build.ninja
    

    Then proceed with the usual:

    cmake --build .
    

    Don't forget to nuke the sqldrivers directory first :-)

    D 1 Reply Last reply
    3
    • hskoglundH hskoglund

      Hi, found it: https://forum.qt.io/topic/136231/mysql-plugin-on-m1-mac/10

      Adding -DCMAKE_OSX_ARCHITECTURES="arm64" has not been sufficient for a looong time.

      The good news is that for Qt 6.7.0 it's slightly easier. Anyway there are two things that has be fixed: build with Nnja and manually edit the Ninja build file before issuing the cmake --build .

      So the qt-cmake command should be:
      ~/Qt/6.7.0/macos/bin/qt-cmake -GNinja -DMySQL_LIBRARY=/opt/homebrew/opt/mysql/lib/libmysqlclient.dylib -DMySQL_INCLUDE_DIR=/opt/homebrew/opt/mysql/include/mysql -DCMAKE_OSX_ARCHITECTURES="arm64" .

      Once it's done, do this magic command:

      sed -i -e 's/-arch x86_64/-arch arm64/g' build.ninja
      

      Then proceed with the usual:

      cmake --build .
      

      Don't forget to nuke the sqldrivers directory first :-)

      D Offline
      D Offline
      DeadSo0ul
      wrote on last edited by
      #22

      @hskoglund
      That worked! Thank you so much.

      1 Reply Last reply
      0
      • hskoglundH hskoglund referenced this topic on
      • H he_R0 referenced this topic on
      • hskoglundH hskoglund referenced this topic on

      • Login

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