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 creating mysql plugin in Qt6.6 on linux
Forum Updated to NodeBB v4.3 + New Features

Problems creating mysql plugin in Qt6.6 on linux

Scheduled Pinned Locked Moved Solved General and Desktop
5 Posts 2 Posters 764 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.
  • G Offline
    G Offline
    gdlaird
    wrote on last edited by
    #1

    Hello,

    I am running Qt6.6.0 on a linux machine and I am trying to build the mysql plugin. I have the required library file (libmysqlclient.so) stored in /usr/lib64. The include files are in /usr/include/mysql.
    I have created a directory build-sqldrivers and have followed the directions in the Qt doc for building mysql plugins for unix machines.
    I run this qt-cmake command:
    /usr/local/Qt6/6.6.0/gcc_64/bin/qt-cmake -G Ninja /usr/local/Qt6/6.6.0/Src/qtbasesrc/plugins/sqldrivers -DCMAKE_INSTALL_PREFIX=/usr/local/Qt6/6.6.0/gcc_64 -DMySQL_INCLUDE_DIR="/usr/include/mysql" -DMySQL_LIBRARY="/usr/lib64/libmysqlclient.so"

    -- Configuring done
    -- Generating done
    -- Build files have been written to: /home/glaird/build-sqldrivers

    I then run (from build-sqldrivers directory) cmake -- build .
    I get the following error message:

    ~/build-sqldrivers> cmake --build .
    [10/19] Building CXX object mysql/CMakeFiles/QMYSQLDriverPlugin.dir/qsql_mysql.cpp.o
    FAILED: mysql/CMakeFiles/QMYSQLDriverPlugin.dir/qsql_mysql.cpp.o
    /usr/bin/c++ -DQMYSQLDriverPlugin_EXPORTS -DQT_CORE_LIB -DQT_DEPRECATED_WARNINGS -DQT_DISABLE_DEPRECATED_UP_TO=0x050000 -DQT_EXPLICIT_QFILE_CONSTRUCTION_FROM_PATH -DQT_NO_AS_CONST -DQT_NO_CAST_FROM_ASCII -DQT_NO_CAST_TO_ASCII -DQT_NO_DEBUG -DQT_NO_EXCEPTIONS -DQT_NO_JAVA_STYLE_ITERATORS -DQT_NO_NARROWING_CONVERSIONS_IN_CONNECT -DQT_NO_QEXCHANGE -DQT_PLUGIN -DQT_SQL_LIB -DQT_WARN_DEPRECATED_UP_TO=0x070000 -D_LARGEFILE64_SOURCE -D_LARGEFILE_SOURCE -Imysql/QMYSQLDriverPlugin_autogen/include -I/usr/local/Qt6/6.6.0/Src/qtbase/src/plugins/sqldrivers/mysql -Imysql -Iinclude -isystem /usr/include/mysql -isystem /usr/local/Qt6/6.6.0/gcc_64/include/QtCore -isystem /usr/local/Qt6/6.6.0/gcc_64/include -isystem /usr/local/Qt6/6.6.0/gcc_64/mkspecs/linux-g++ -isystem /usr/local/Qt6/6.6.0/gcc_64/include/QtCore/6.6.0 -isystem /usr/local/Qt6/6.6.0/gcc_64/include/QtCore/6.6.0/QtCore -isystem /usr/local/Qt6/6.6.0/gcc_64/include/QtSql/6.6.0 -isystem /usr/local/Qt6/6.6.0/gcc_64/include/QtSql/6.6.0/QtSql -isystem /usr/local/Qt6/6.6.0/gcc_64/include/QtSql -g -DNDEBUG -O2 -fPIC -fvisibility=hidden -fvisibility-inlines-hidden -Wall -Wextra -fno-exceptions -fPIC -pthread -Wsuggest-override -std=c++1z -MD -MT mysql/CMakeFiles/QMYSQLDriverPlugin.dir/qsql_mysql.cpp.o -MF mysql/CMakeFiles/QMYSQLDriverPlugin.dir/qsql_mysql.cpp.o.d -o mysql/CMakeFiles/QMYSQLDriverPlugin.dir/qsql_mysql.cpp.o -c /usr/local/Qt6/6.6.0/Src/qtbase/src/plugins/sqldrivers/mysql/qsql_mysql.cpp
    In file included from /usr/local/Qt6/6.6.0/Src/qtbase/src/plugins/sqldrivers/mysql/qsql_mysql.cpp:11:0:
    /usr/local/Qt6/6.6.0/gcc_64/include/QtCore/qfile.h:13:10: fatal error: filesystem: No such file or directory
    #include <filesystem>
    ^~~~~~~~~~~~
    compilation terminated.
    [15/19] Building CXX object odbc/CMakeFiles/QODBCDriverPlugin.dir/qsql_odbc.cpp.o
    ninja: build stopped: subcommand failed.

    Anyone know how I can fix the #include <filesystem> error?

    Thanks.

    Christian EhrlicherC 1 Reply Last reply
    0
    • G gdlaird

      Hello,

      I am running Qt6.6.0 on a linux machine and I am trying to build the mysql plugin. I have the required library file (libmysqlclient.so) stored in /usr/lib64. The include files are in /usr/include/mysql.
      I have created a directory build-sqldrivers and have followed the directions in the Qt doc for building mysql plugins for unix machines.
      I run this qt-cmake command:
      /usr/local/Qt6/6.6.0/gcc_64/bin/qt-cmake -G Ninja /usr/local/Qt6/6.6.0/Src/qtbasesrc/plugins/sqldrivers -DCMAKE_INSTALL_PREFIX=/usr/local/Qt6/6.6.0/gcc_64 -DMySQL_INCLUDE_DIR="/usr/include/mysql" -DMySQL_LIBRARY="/usr/lib64/libmysqlclient.so"

      -- Configuring done
      -- Generating done
      -- Build files have been written to: /home/glaird/build-sqldrivers

      I then run (from build-sqldrivers directory) cmake -- build .
      I get the following error message:

      ~/build-sqldrivers> cmake --build .
      [10/19] Building CXX object mysql/CMakeFiles/QMYSQLDriverPlugin.dir/qsql_mysql.cpp.o
      FAILED: mysql/CMakeFiles/QMYSQLDriverPlugin.dir/qsql_mysql.cpp.o
      /usr/bin/c++ -DQMYSQLDriverPlugin_EXPORTS -DQT_CORE_LIB -DQT_DEPRECATED_WARNINGS -DQT_DISABLE_DEPRECATED_UP_TO=0x050000 -DQT_EXPLICIT_QFILE_CONSTRUCTION_FROM_PATH -DQT_NO_AS_CONST -DQT_NO_CAST_FROM_ASCII -DQT_NO_CAST_TO_ASCII -DQT_NO_DEBUG -DQT_NO_EXCEPTIONS -DQT_NO_JAVA_STYLE_ITERATORS -DQT_NO_NARROWING_CONVERSIONS_IN_CONNECT -DQT_NO_QEXCHANGE -DQT_PLUGIN -DQT_SQL_LIB -DQT_WARN_DEPRECATED_UP_TO=0x070000 -D_LARGEFILE64_SOURCE -D_LARGEFILE_SOURCE -Imysql/QMYSQLDriverPlugin_autogen/include -I/usr/local/Qt6/6.6.0/Src/qtbase/src/plugins/sqldrivers/mysql -Imysql -Iinclude -isystem /usr/include/mysql -isystem /usr/local/Qt6/6.6.0/gcc_64/include/QtCore -isystem /usr/local/Qt6/6.6.0/gcc_64/include -isystem /usr/local/Qt6/6.6.0/gcc_64/mkspecs/linux-g++ -isystem /usr/local/Qt6/6.6.0/gcc_64/include/QtCore/6.6.0 -isystem /usr/local/Qt6/6.6.0/gcc_64/include/QtCore/6.6.0/QtCore -isystem /usr/local/Qt6/6.6.0/gcc_64/include/QtSql/6.6.0 -isystem /usr/local/Qt6/6.6.0/gcc_64/include/QtSql/6.6.0/QtSql -isystem /usr/local/Qt6/6.6.0/gcc_64/include/QtSql -g -DNDEBUG -O2 -fPIC -fvisibility=hidden -fvisibility-inlines-hidden -Wall -Wextra -fno-exceptions -fPIC -pthread -Wsuggest-override -std=c++1z -MD -MT mysql/CMakeFiles/QMYSQLDriverPlugin.dir/qsql_mysql.cpp.o -MF mysql/CMakeFiles/QMYSQLDriverPlugin.dir/qsql_mysql.cpp.o.d -o mysql/CMakeFiles/QMYSQLDriverPlugin.dir/qsql_mysql.cpp.o -c /usr/local/Qt6/6.6.0/Src/qtbase/src/plugins/sqldrivers/mysql/qsql_mysql.cpp
      In file included from /usr/local/Qt6/6.6.0/Src/qtbase/src/plugins/sqldrivers/mysql/qsql_mysql.cpp:11:0:
      /usr/local/Qt6/6.6.0/gcc_64/include/QtCore/qfile.h:13:10: fatal error: filesystem: No such file or directory
      #include <filesystem>
      ^~~~~~~~~~~~
      compilation terminated.
      [15/19] Building CXX object odbc/CMakeFiles/QODBCDriverPlugin.dir/qsql_odbc.cpp.o
      ninja: build stopped: subcommand failed.

      Anyone know how I can fix the #include <filesystem> error?

      Thanks.

      Christian EhrlicherC Offline
      Christian EhrlicherC Offline
      Christian Ehrlicher
      Lifetime Qt Champion
      wrote on last edited by
      #2

      @gdlaird You are using a gcc which is too old as it seems. It needs to support c++ 17

      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
      1
      • G Offline
        G Offline
        gdlaird
        wrote on last edited by
        #3

        Thanks for the reply. I am running opensuse 15.4 with the most current gcc/g++ compiler (gcc12). But I have older versions as well. So, probably what is happening is that an older version is running when I assumed the most current was running. I will try to figure out how to set the default version.

        G 1 Reply Last reply
        0
        • G gdlaird

          Thanks for the reply. I am running opensuse 15.4 with the most current gcc/g++ compiler (gcc12). But I have older versions as well. So, probably what is happening is that an older version is running when I assumed the most current was running. I will try to figure out how to set the default version.

          G Offline
          G Offline
          gdlaird
          wrote on last edited by
          #4

          @gdlaird
          I had always assumed that when I installed a newer version of gcc, the installation process would update the gcc/g++ link to point to the new version--so that executing gcc/g++ would run the newest version.
          So, this is not the case. I thought I was using gcc-12 and actually I was using gcc-7. So, I fixed this problem using the 'update-alternatives' configuration routine. Now, things work correctly and I have got the mysql plugin working.
          Thanks again!

          Christian EhrlicherC 1 Reply Last reply
          1
          • G gdlaird

            @gdlaird
            I had always assumed that when I installed a newer version of gcc, the installation process would update the gcc/g++ link to point to the new version--so that executing gcc/g++ would run the newest version.
            So, this is not the case. I thought I was using gcc-12 and actually I was using gcc-7. So, I fixed this problem using the 'update-alternatives' configuration routine. Now, things work correctly and I have got the mysql plugin working.
            Thanks again!

            Christian EhrlicherC Offline
            Christian EhrlicherC Offline
            Christian Ehrlicher
            Lifetime Qt Champion
            wrote on last edited by
            #5

            Nice to hear, please mark the topic as solved then.

            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
            • G gdlaird has marked this topic as solved on

            • Login

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