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. Trouble Building MySQL Driver
QtWS25 Last Chance

Trouble Building MySQL Driver

Scheduled Pinned Locked Moved General and Desktop
mysqldriver
5 Posts 3 Posters 1.9k 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.
  • R Offline
    R Offline
    rofln
    wrote on 8 Nov 2015, 04:55 last edited by
    #1
    This post is deleted!
    1 Reply Last reply
    0
    • C Offline
      C Offline
      Calvev
      wrote on 8 Nov 2015, 08:10 last edited by
      #2

      Hello,

      I encountered similar issue before. I solved it by downloading mysql dll for C from mysql website, I then proceed to move my libmysql.dll into the same folder as my executable.

      1 Reply Last reply
      0
      • S Offline
        S Offline
        SGaist
        Lifetime Qt Champion
        wrote on 8 Nov 2015, 22:31 last edited by
        #3

        Hi and welcome to devnet,

        Please search the form a bit, that question has been asked many times already. You need to install Qt's sources and build the MySQL plugin. The sources can be installed through e.g. the Online Installer

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

        1 Reply Last reply
        0
        • R Offline
          R Offline
          rofln
          wrote on 12 Nov 2015, 01:15 last edited by
          #4

          Hi,

          Sorry for delayed response. I made some progress, I think. I finally found the Qt source code and now I'm trying to build the plugin from source. I'm now getting an error when I call make. Here's the console output:

          rofln@ubuntu:~/Desktop/qt-everywhere-opensource-src-5.5.1/qtbase/src/plugins/sqldrivers/mysql$ /opt/Qt/5.5/gcc_64/bin/qmake "INCLUDEPATH+=/usr/include/mysql" "LIBS+=-L/usr/lib/mysql -ldl -lmysqlclient_r" mysql.pro
          rofln@ubuntu:~/Desktop/qt-everywhere-opensource-src-5.5.1/qtbase/src/plugins/sqldrivers/mysql$ make
             ****compiler stuff*****
           
              /usr/lib64/mysql/libmysqlclient_r.a(client_plugin.c.o): In function `do_add_plugin':
           /export/home/pb2/build/sb_0-14542007-1424899317.1/rpm/BUILD/mysql-connector-c-6.1.6-src/mysql-connector-c-6.1.6-    src/sql-common/client_plugin.c:245: undefined reference to `dlclose'
          
          
          /usr/lib64/mysql/libmysqlclient_r.a(client_plugin.c.o): In function `mysql_client_plugin_deinit':
          /export/home/pb2/build/sb_0-14542007-1424899317.1/rpm/BUILD/mysql-connector-c-6.1.6-src/mysql-connector-c-6.1.6-src/sql-common/client_plugin.c:381: undefined reference to `dlclose'
          
          
          /usr/lib64/mysql/libmysqlclient_r.a(client_plugin.c.o): In function `mysql_load_plugin_v':
          /export/home/pb2/build/sb_0-14542007-1424899317.1/rpm/BUILD/mysql-connector-c-6.1.6-src/mysql-connector-c-6.1.6-src/sql-common/client_plugin.c:469: undefined reference to `dlopen'
          /export/home/pb2/build/sb_0-14542007-1424899317.1/rpm/BUILD/mysql-connector-c-6.1.6-src/mysql-connector-c-6.1.6-src/sql-common/client_plugin.c:497: undefined reference to `dlsym'
          
          /export/home/pb2/build/sb_0-14542007-1424899317.1/rpm/BUILD/mysql-connector-c-6.1.6-src/mysql-connector-c-6.1.6-src/sql-common/client_plugin.c:488: undefined reference to `dlerror'
          
          /export/home/pb2/build/sb_0-14542007-1424899317.1/rpm/BUILD/mysql-connector-c-6.1.6-src/mysql-connector-c-6.1.6-src/sql-common/client_plugin.c:500: undefined reference to `dlclose'
          

          I looked online to find that I had to add the -ldl linker flag. I've tried it before and after the -lmysqlclient_r flag but get the same output. Any ideas?

          1 Reply Last reply
          0
          • R Offline
            R Offline
            rofln
            wrote on 12 Nov 2015, 02:52 last edited by
            #5

            Finally fixed it. I had the wrong file path to my shared library files.

            1 Reply Last reply
            0

            1/5

            8 Nov 2015, 04:55

            • Login

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