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 + Qt 5.7 integration on Ubuntu 16.04
Forum Updated to NodeBB v4.3 + New Features

MySQL + Qt 5.7 integration on Ubuntu 16.04

Scheduled Pinned Locked Moved Solved General and Desktop
mysqldriver not loadubuntu 16.04
13 Posts 4 Posters 9.5k 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.
  • P p3c0
    7 Jan 2017, 13:51

    @ErranusCaminhus This problem has been answered several times on this forum. Try using the search functionality of the forum. Here's one that might help:
    https://forum.qt.io/topic/59449/qsqldatabase-qmysql-driver-not-loaded-build-mysql-plugin

    E Offline
    E Offline
    ErranusCaminhus
    wrote on 7 Jan 2017, 14:58 last edited by
    #4

    @p3c0 said in MySQL + Qt 5.7 integration on Ubuntu 16.04:

    @ErranusCaminhus This problem has been answered several times on this forum. Try using the search functionality of the forum. Here's one that might help:
    https://forum.qt.io/topic/59449/qsqldatabase-qmysql-driver-not-loaded-build-mysql-plugin

    Hi, really appreciate your quick response!
    As I stated, I read many of the topics with related issues and tried all possible combination of solutions. Bit I gave it another try!

    Following step-bystep guide from user mattewre:

    • Clean Ubuntu 14.04 installation: OK
      Installed QT in the user Home: OK
      During the installation select all "Source Components": OK
      Install a compiler: OK
      Write you project and you will face problems with: db = QsqlDatabase::addDatabase("QMYSQL"); OK (As can be seen in first post)

    • Read this line of the output: libmysqlclient_r.so.16 => not found. (Still not found.)

    • Install these packages
      sudo apt-get install libssl-dev
      sudo apt-get install libmysqlclient-dev
      2 of the 3 libraries are still not found after installing referred packages, as can be seen bellow. Actuality libmysqlclient_r.so.16 was installed by the package pointed in his second post (http://launchpadlibrarian.net/94808408/libmysqlclient16_5.1.58-1ubuntu5_amd64.deb):

    guilherme@k45a:~/Programs/Qt/5.7/gcc_64/plugins/sqldrivers$ ldd libqsqlmysql.so
    linux-vdso.so.1 => (0x00007fff16edf000)
    libmysqlclient_r.so.16 => /usr/lib/x86_64-linux-gnu/libmysqlclient_r.so.16 (0x00007f92ac8da000)
    libz.so.1 => /lib/x86_64-linux-gnu/libz.so.1 (0x00007f92ac6c0000)
    libcrypt.so.1 => /lib/x86_64-linux-gnu/libcrypt.so.1 (0x00007f92ac487000)
    libnsl.so.1 => /lib/x86_64-linux-gnu/libnsl.so.1 (0x00007f92ac26e000)
    libssl.so.10 => not found
    libcrypto.so.10 => not found

    libQt5Sql.so.5 => /home/guilherme/Programs/Qt/5.7/gcc_64/plugins/sqldrivers/./../../lib/libQt5Sql.so.5 (0x00007f92ac028000)
    libQt5Core.so.5 => /home/guilherme/Programs/Qt/5.7/gcc_64/plugins/sqldrivers/./../../lib/libQt5Core.so.5 (0x00007f92ab90a000)
    libpthread.so.0 => /lib/x86_64-linux-gnu/libpthread.so.0 (0x00007f92ab6ec000)
    libstdc++.so.6 => /usr/lib/x86_64-linux-gnu/libstdc++.so.6 (0x00007f92ab36a000)
    libm.so.6 => /lib/x86_64-linux-gnu/libm.so.6 (0x00007f92ab061000)
    libgcc_s.so.1 => /lib/x86_64-linux-gnu/libgcc_s.so.1 (0x00007f92aae4a000)
    libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007f92aaa81000)
    libicui18n.so.56 => /home/guilherme/Programs/Qt/5.7/gcc_64/plugins/sqldrivers/./../../lib/libicui18n.so.56 (0x00007f92aa5e6000)
    libicuuc.so.56 => /home/guilherme/Programs/Qt/5.7/gcc_64/plugins/sqldrivers/./../../lib/libicuuc.so.56 (0x00007f92aa22e000)
    libicudata.so.56 => /home/guilherme/Programs/Qt/5.7/gcc_64/plugins/sqldrivers/./../../lib/libicudata.so.56 (0x00007f92a884b000)
    libdl.so.2 => /lib/x86_64-linux-gnu/libdl.so.2 (0x00007f92a8646000)
    libgthread-2.0.so.0 => /usr/lib/x86_64-linux-gnu/libgthread-2.0.so.0 (0x00007f92a8444000)
    librt.so.1 => /lib/x86_64-linux-gnu/librt.so.1 (0x00007f92a823c000)
    libglib-2.0.so.0 => /lib/x86_64-linux-gnu/libglib-2.0.so.0 (0x00007f92a7f2a000)
    /lib64/ld-linux-x86-64.so.2 (0x000055e897bba000)
    libpcre.so.3 => /lib/x86_64-linux-gnu/libpcre.so.3 (0x00007f92a7cba000)

    • Now you should build the MYSQL plugin, according to http://doc.qt.io/qt-5/sql-driver.html documentation:
      cd /home/[yourUsername]/Qt/[QtVersion]/Src/qtbase/src/plugins/sqldrivers/mysql
      Then use the qmake provided in your Qt5.5 installation
      /home/[yourUsername]/Qt/[QtVersion]/gcc/bin/qmake
      My qmake output: returns error:
      guilherme@k45a:~/Programs/Qt/5.7/Src/qtbase/src/plugins/sqldrivers/mysql$ make
      /home/guilherme/Programs/Qt/5.7/gcc_64/bin/moc -DQT_NO_MTDEV -DQT_NO_LIBUDEV -DQT_NO_TSLIB -DQT_NO_LIBINPUT -DQT_NO_CAST_TO_ASCII -DQT_NO_CAST_FROM_ASCII -DQT_NO_EXCEPTIONS -D_LARGEFILE64_SOURCE -D_LARGEFILE_SOURCE -DQT_NO_DEBUG -DQT_PLUGIN -DQT_SQL_LIB -DQT_CORE_LIB -I/home/guilherme/Programs/Qt/5.7/Src/qtbase/mkspecs/linux-g++ -I/home/guilherme/Programs/Qt/5.7/Src/qtbase/src/plugins/sqldrivers/mysql -I/home/guilherme/Programs/Qt/5.7/gcc_64/include/QtSql/5.7.1 -I/home/guilherme/Programs/Qt/5.7/gcc_64/include/QtSql/5.7.1/QtSql -I/home/guilherme/Programs/Qt/5.7/gcc_64/include/QtCore/5.7.1 -I/home/guilherme/Programs/Qt/5.7/gcc_64/include/QtCore/5.7.1/QtCore -I/home/guilherme/Programs/Qt/5.7/gcc_64/include -I/home/guilherme/Programs/Qt/5.7/gcc_64/include/QtSql -I/home/guilherme/Programs/Qt/5.7/gcc_64/include/QtCore -I/usr/include/c++/5 -I/usr/include/x86_64-linux-gnu/c++/5 -I/usr/include/c++/5/backward -I/usr/lib/gcc/x86_64-linux-gnu/5/include -I/usr/local/include -I/usr/lib/gcc/x86_64-linux-gnu/5/include-fixed -I/usr/include/x86_64-linux-gnu -I/usr/include main.cpp -o .moc/main.moc
      g++ -c -pipe -I/usr/include/mysql -O2 -std=c++1y -fvisibility=hidden -fvisibility-inlines-hidden -fno-exceptions -Wall -W -Wvla -D_REENTRANT -fPIC -DQT_NO_MTDEV -DQT_NO_LIBUDEV -DQT_NO_TSLIB -DQT_NO_LIBINPUT -DQT_NO_CAST_TO_ASCII -DQT_NO_CAST_FROM_ASCII -DQT_NO_EXCEPTIONS -D_LARGEFILE64_SOURCE -D_LARGEFILE_SOURCE -DQT_NO_DEBUG -DQT_PLUGIN -DQT_SQL_LIB -DQT_CORE_LIB -I. -I/home/guilherme/Programs/Qt/5.7/gcc_64/include/QtSql/5.7.1 -I/home/guilherme/Programs/Qt/5.7/gcc_64/include/QtSql/5.7.1/QtSql -I/home/guilherme/Programs/Qt/5.7/gcc_64/include/QtCore/5.7.1 -I/home/guilherme/Programs/Qt/5.7/gcc_64/include/QtCore/5.7.1/QtCore -I/home/guilherme/Programs/Qt/5.7/gcc_64/include -I/home/guilherme/Programs/Qt/5.7/gcc_64/include/QtSql -I/home/guilherme/Programs/Qt/5.7/gcc_64/include/QtCore -I.moc -I../../../../mkspecs/linux-g++ -o .obj/main.o main.cpp
      g++ -c -pipe -I/usr/include/mysql -O2 -std=c++1y -fvisibility=hidden -fvisibility-inlines-hidden -fno-exceptions -Wall -W -Wvla -D_REENTRANT -fPIC -DQT_NO_MTDEV -DQT_NO_LIBUDEV -DQT_NO_TSLIB -DQT_NO_LIBINPUT -DQT_NO_CAST_TO_ASCII -DQT_NO_CAST_FROM_ASCII -DQT_NO_EXCEPTIONS -D_LARGEFILE64_SOURCE -D_LARGEFILE_SOURCE -DQT_NO_DEBUG -DQT_PLUGIN -DQT_SQL_LIB -DQT_CORE_LIB -I. -I/home/guilherme/Programs/Qt/5.7/gcc_64/include/QtSql/5.7.1 -I/home/guilherme/Programs/Qt/5.7/gcc_64/include/QtSql/5.7.1/QtSql -I/home/guilherme/Programs/Qt/5.7/gcc_64/include/QtCore/5.7.1 -I/home/guilherme/Programs/Qt/5.7/gcc_64/include/QtCore/5.7.1/QtCore -I/home/guilherme/Programs/Qt/5.7/gcc_64/include -I/home/guilherme/Programs/Qt/5.7/gcc_64/include/QtSql -I/home/guilherme/Programs/Qt/5.7/gcc_64/include/QtCore -I.moc -I../../../../mkspecs/linux-g++ -o .obj/qsql_mysql.o ../../../sql/drivers/mysql/qsql_mysql.cpp
      /home/guilherme/Programs/Qt/5.7/gcc_64/bin/moc -DQT_NO_MTDEV -DQT_NO_LIBUDEV -DQT_NO_TSLIB -DQT_NO_LIBINPUT -DQT_NO_CAST_TO_ASCII -DQT_NO_CAST_FROM_ASCII -DQT_NO_EXCEPTIONS -D_LARGEFILE64_SOURCE -D_LARGEFILE_SOURCE -DQT_NO_DEBUG -DQT_PLUGIN -DQT_SQL_LIB -DQT_CORE_LIB -I/home/guilherme/Programs/Qt/5.7/Src/qtbase/mkspecs/linux-g++ -I/home/guilherme/Programs/Qt/5.7/Src/qtbase/src/plugins/sqldrivers/mysql -I/home/guilherme/Programs/Qt/5.7/gcc_64/include/QtSql/5.7.1 -I/home/guilherme/Programs/Qt/5.7/gcc_64/include/QtSql/5.7.1/QtSql -I/home/guilherme/Programs/Qt/5.7/gcc_64/include/QtCore/5.7.1 -I/home/guilherme/Programs/Qt/5.7/gcc_64/include/QtCore/5.7.1/QtCore -I/home/guilherme/Programs/Qt/5.7/gcc_64/include -I/home/guilherme/Programs/Qt/5.7/gcc_64/include/QtSql -I/home/guilherme/Programs/Qt/5.7/gcc_64/include/QtCore -I/usr/include/c++/5 -I/usr/include/x86_64-linux-gnu/c++/5 -I/usr/include/c++/5/backward -I/usr/lib/gcc/x86_64-linux-gnu/5/include -I/usr/local/include -I/usr/lib/gcc/x86_64-linux-gnu/5/include-fixed -I/usr/include/x86_64-linux-gnu -I/usr/include ../../../sql/drivers/mysql/qsql_mysql_p.h -o .moc/moc_qsql_mysql_p.cpp
      g++ -c -pipe -I/usr/include/mysql -O2 -std=c++1y -fvisibility=hidden -fvisibility-inlines-hidden -fno-exceptions -Wall -W -Wvla -D_REENTRANT -fPIC -DQT_NO_MTDEV -DQT_NO_LIBUDEV -DQT_NO_TSLIB -DQT_NO_LIBINPUT -DQT_NO_CAST_TO_ASCII -DQT_NO_CAST_FROM_ASCII -DQT_NO_EXCEPTIONS -D_LARGEFILE64_SOURCE -D_LARGEFILE_SOURCE -DQT_NO_DEBUG -DQT_PLUGIN -DQT_SQL_LIB -DQT_CORE_LIB -I. -I/home/guilherme/Programs/Qt/5.7/gcc_64/include/QtSql/5.7.1 -I/home/guilherme/Programs/Qt/5.7/gcc_64/include/QtSql/5.7.1/QtSql -I/home/guilherme/Programs/Qt/5.7/gcc_64/include/QtCore/5.7.1 -I/home/guilherme/Programs/Qt/5.7/gcc_64/include/QtCore/5.7.1/QtCore -I/home/guilherme/Programs/Qt/5.7/gcc_64/include -I/home/guilherme/Programs/Qt/5.7/gcc_64/include/QtSql -I/home/guilherme/Programs/Qt/5.7/gcc_64/include/QtCore -I.moc -I../../../../mkspecs/linux-g++ -o .obj/moc_qsql_mysql_p.o .moc/moc_qsql_mysql_p.cpp
      rm -f libqsqlmysql.so
      g++ -Wl,--no-undefined -Wl,-O1 -Wl,--enable-new-dtags -Wl,-z,origin -Wl,-rpath,$ORIGIN/../../lib -Wl,-rpath,$ORIGIN/../../lib -shared -o libqsqlmysql.so .obj/main.o .obj/qsql_mysql.o .obj/moc_qsql_mysql_p.o -L/usr/lib64/mysql -lmysqlclient_r -lz -lcrypt -lnsl -lm -lssl -lcrypto -L/home/guilherme/Programs/Qt/5.7/gcc_64/lib -lQt5Sql -lQt5Core -lpthread
      /usr/bin/ld: cannot find -lmysqlclient_r
      collect2: error: ld returned 1 exit status
      Makefile:114: recipe for target '../../../../plugins/sqldrivers/libqsqlmysql.so' failed
      make: *** [../../../../plugins/sqldrivers/libqsqlmysql.so] Error 1

    • And make output:
      guilherme@k45a:~/Programs/Qt/5.7/Src/qtbase/src/plugins/sqldrivers/mysql$ make
      rm -f libqsqlmysql.so
      g++ -Wl,--no-undefined -Wl,-O1 -Wl,--enable-new-dtags -Wl,-z,origin -Wl,-rpath,$ORIGIN/../../lib -Wl,-rpath,$ORIGIN/../../lib -shared -o libqsqlmysql.so .obj/main.o .obj/qsql_mysql.o .obj/moc_qsql_mysql_p.o -L/usr/lib64/mysql -lmysqlclient_r -lz -lcrypt -lnsl -lm -lssl -lcrypto -L/home/guilherme/Programs/Qt/5.7/gcc_64/lib -lQt5Sql -lQt5Core -lpthread
      /usr/bin/ld: cannot find -lmysqlclient_r
      collect2: error: ld returned 1 exit status
      Makefile:114: recipe for target '../../../../plugins/sqldrivers/libqsqlmysql.so' failed
      make: *** [../../../../plugins/sqldrivers/libqsqlmysql.so] Error 1

    • make install returns error pointed out by the guide:
      guilherme@k45a:~/Programs/Qt/5.7/Src/qtbase/src/plugins/sqldrivers/mysql$ make install
      rm -f libqsqlmysql.so
      g++ -Wl,--no-undefined -Wl,-O1 -Wl,--enable-new-dtags -Wl,-z,origin -Wl,-rpath,$ORIGIN/../../lib -Wl,-rpath,$ORIGIN/../../lib -shared -o libqsqlmysql.so .obj/main.o .obj/qsql_mysql.o .obj/moc_qsql_mysql_p.o -L/usr/lib64/mysql -lmysqlclient_r -lz -lcrypt -lnsl -lm -lssl -lcrypto -L/home/guilherme/Programs/Qt/5.7/gcc_64/lib -lQt5Sql -lQt5Core -lpthread
      /usr/bin/ld: cannot find -lmysqlclient_r
      collect2: error: ld returned 1 exit status
      Makefile:114: recipe for target '../../../../plugins/sqldrivers/libqsqlmysql.so' failed
      make: *** [../../../../plugins/sqldrivers/libqsqlmysql.so] Error 1

    • Make some symbolic links to make it working (please check mysql version, it could not be 18.1.0 in the future):
      sudo ln -s /usr/lib/i386-linux-gnu/libmysqlclient.so /usr/lib/i386-linux-gnu/libmysqlclient_r.so
      guilherme@k45a:~$ sudo ln -s /usr/lib/i386-linux-gnu/libmysqlclient.so /usr/lib/i386-linux-gnu/libmysqlclient_r.so
      ln: failed to create symbolic link '/usr/lib/i386-linux-gnu/libmysqlclient_r.so': File exists
      sudo ln -s /usr/lib/i386-linux-gnu/libmysqlclient.so /usr/lib/i386-linux-gnu/libmysqlclient_r.so.18
      OK
      sudo ln -s /usr/lib/i386-linux-gnu/libmysqlclient.so /usr/lib/i386-linux-gnu/libmysqlclient_r.so.18.1.0
      OK

    • Runing again make i have the same errors:
      make
      It seems that the plugin have been built correctly. Last output is:
      mv -f libqsqlmysql.so ../../../../plugins/sqldrivers/
      and finally run:
      make install
      guilherme@k45a:~/Programs/Qt/5.7/Src/qtbase/src/plugins/sqldrivers/mysql$ make
      rm -f libqsqlmysql.so
      g++ -Wl,--no-undefined -Wl,-O1 -Wl,--enable-new-dtags -Wl,-z,origin -Wl,-rpath,$ORIGIN/../../lib -Wl,-rpath,$ORIGIN/../../lib -shared -o libqsqlmysql.so .obj/main.o .obj/qsql_mysql.o .obj/moc_qsql_mysql_p.o -L/usr/lib64/mysql -lmysqlclient_r -lz -lcrypt -lnsl -lm -lssl -lcrypto -L/home/guilherme/Programs/Qt/5.7/gcc_64/lib -lQt5Sql -lQt5Core -lpthread
      /usr/bin/ld: cannot find -lmysqlclient_r
      collect2: error: ld returned 1 exit status
      Makefile:114: recipe for target '../../../../plugins/sqldrivers/libqsqlmysql.so' failed
      make: *** [../../../../plugins/sqldrivers/libqsqlmysql.so] Error 1
      guilherme@k45a:~/Programs/Qt/5.7/Src/qtbase/src/plugins/sqldrivers/mysql$ make install
      rm -f libqsqlmysql.so
      g++ -Wl,--no-undefined -Wl,-O1 -Wl,--enable-new-dtags -Wl,-z,origin -Wl,-rpath,$ORIGIN/../../lib -Wl,-rpath,$ORIGIN/../../lib -shared -o libqsqlmysql.so .obj/main.o .obj/qsql_mysql.o .obj/moc_qsql_mysql_p.o -L/usr/lib64/mysql -lmysqlclient_r -lz -lcrypt -lnsl -lm -lssl -lcrypto -L/home/guilherme/Programs/Qt/5.7/gcc_64/lib -lQt5Sql -lQt5Core -lpthread
      /usr/bin/ld: cannot find -lmysqlclient_r
      collect2: error: ld returned 1 exit status
      Makefile:114: recipe for target '../../../../plugins/sqldrivers/libqsqlmysql.so' failed
      make: *** [../../../../plugins/sqldrivers/libqsqlmysql.so] Error 1

    And still getting "driver not loaded".

    Do you have any other suggestion?

    1 Reply Last reply
    0
    • M mrjj
      7 Jan 2017, 13:52

      Hi
      It seems it cant find libmysqlclient_r.so.16
      ( the actual mysql client so file)

      IF you see this post
      https://forum.qt.io/topic/59449/qsqldatabase-qmysql-driver-not-loaded-build-mysql-plugin/2

      Seems to be exact same issue.

      libmysqlclient_r.so.16 => not found

      So you did rebuild the plugin ? So it will use your installed client so-s ?
      http://doc.qt.io/qt-5/sql-driver.html

      Update: @p3c0 beat me to it :) so info is redundant but still important if you rebuild the plugin or not.

      E Offline
      E Offline
      ErranusCaminhus
      wrote on 7 Jan 2017, 15:19 last edited by
      #5

      @mrjj said in MySQL + Qt 5.7 integration on Ubuntu 16.04:

      Hi
      It seems it cant find libmysqlclient_r.so.16
      ( the actual mysql client so file)
      IF you see this post
      https://forum.qt.io/topic/59449/qsqldatabase-qmysql-driver-not-loaded-build-mysql-plugin/2
      Seems to be exact same issue.
      libmysqlclient_r.so.16 => not found
      So you did rebuild the plugin ? So it will use your installed client so-s ?
      http://doc.qt.io/qt-5/sql-driver.html
      Update: @p3c0 beat me to it :) so info is redundant but still important if you rebuild the plugin or not.

      Hi! @mrjj. I appreciate you reply!
      After installing libmysqlclient deb package supplied in the step-by-step post, i can see now that libmysqlclient_r.so.16 doesn't have dependency not found anymore, but i have the same fault for the other 2 libraries:
      libssl.so.10 => not found
      libcrypto.so.10 => not found

      After that, following along the step-by-step, even if i have libmysqlclient present, qmake and make are still throwing errors which i described in the last post.
      Actually i'm not certain if i rebuilt the plugin as you suggested.
      Do you mean qmake and make results?
      Could you elaborate on that or do you have any other suggestion?

      Thank you!

      1 Reply Last reply
      0
      • P Offline
        P Offline
        p3c0
        Moderators
        wrote on 7 Jan 2017, 15:47 last edited by
        #6

        Depending upon your distro install libssl package.

        157

        E 1 Reply Last reply 7 Jan 2017, 16:09
        2
        • P p3c0
          7 Jan 2017, 15:47

          Depending upon your distro install libssl package.

          E Offline
          E Offline
          ErranusCaminhus
          wrote on 7 Jan 2017, 16:09 last edited by
          #7

          @p3c0 said in MySQL + Qt 5.7 integration on Ubuntu 16.04:

          Depending upon your distro install libssl package.

          @p3c0

          Yes. Sure i have. See:

          guilherme@k45a:~$ dpkg --get-selections | grep libssl
          libssl-dev:amd64 install
          libssl-doc install
          libssl1.0.0:amd64 install
          libssl1.0.0:i386 install

          1 Reply Last reply
          0
          • M Offline
            M Offline
            mrjj
            Lifetime Qt Champion
            wrote on 7 Jan 2017, 17:41 last edited by mrjj 1 Jul 2017, 17:41
            #8

            Hi
            Yes, it seems you build it.
            Makefile:114: recipe for target '../../../../plugins/sqldrivers/libqsqlmysql.so' failed
            Also +10 for actually reading the posts and try first :)

            There still seems to be a build issue
            /usr/bin/ld: cannot find -lmysqlclient_r

            -lmysqlclient_r

            Its 100% sure its not -llibmysqlclient_r ?

            Im not that used to linux so im afraid i would not spot path mismatches and such things

            Others here might have better suggestions to this fine output :)

            E 1 Reply Last reply 7 Jan 2017, 18:31
            0
            • S Offline
              S Offline
              SGaist
              Lifetime Qt Champion
              wrote on 7 Jan 2017, 18:28 last edited by
              #9

              Hi,

              Unless I misread, you didn't install the development package neither for MySQL nor OpenSSL.

              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 7 Jan 2017, 18:30
              1
              • S SGaist
                7 Jan 2017, 18:28

                Hi,

                Unless I misread, you didn't install the development package neither for MySQL nor OpenSSL.

                M Offline
                M Offline
                mrjj
                Lifetime Qt Champion
                wrote on 7 Jan 2017, 18:30 last edited by mrjj 1 Jul 2017, 18:30
                #10

                @SGaist

                Would that be these ?
                Install these packages
                sudo apt-get install libssl-dev
                sudo apt-get install libmysqlclient-dev
                Thank you

                1 Reply Last reply
                1
                • M mrjj
                  7 Jan 2017, 17:41

                  Hi
                  Yes, it seems you build it.
                  Makefile:114: recipe for target '../../../../plugins/sqldrivers/libqsqlmysql.so' failed
                  Also +10 for actually reading the posts and try first :)

                  There still seems to be a build issue
                  /usr/bin/ld: cannot find -lmysqlclient_r

                  -lmysqlclient_r

                  Its 100% sure its not -llibmysqlclient_r ?

                  Im not that used to linux so im afraid i would not spot path mismatches and such things

                  Others here might have better suggestions to this fine output :)

                  E Offline
                  E Offline
                  ErranusCaminhus
                  wrote on 7 Jan 2017, 18:31 last edited by
                  #11

                  @mrjj said in MySQL + Qt 5.7 integration on Ubuntu 16.04:

                  Hi
                  Yes, it seems you build it.
                  Makefile:114: recipe for target '../../../../plugins/sqldrivers/libqsqlmysql.so' failed
                  Also +10 for actually reading the posts and try first :)
                  There still seems to be a build issue
                  /usr/bin/ld: cannot find -lmysqlclient_r
                  -lmysqlclient_r
                  Its 100% sure its not -llibmysqlclient_r ?
                  Im not that used to linux so im afraid i would not spot path mismatches and such things
                  Others here might have better suggestions to this fine output :)

                  Thank you!
                  I'm happy to say that i feel like the cast away of the movie after making fire!
                  Just managed to solve this issue.

                  Based on this topic: http://askubuntu.com/questions/772024/cannot-compile-qt-5-6-0-mysql-plugin-in-ubuntu-16-04-lts-64bit, what i did was to create one more link:

                  guilherme@k45a:~$ sudo ln -s /usr/lib/x86_64-linux-gnu/libmysqlclient.so /usr/lib/x86_64-linux-gnu/libmysqlclient_r.so

                  After that, qmake, make and make install went well with no errors!

                  I hope this thread help people with the same problem.
                  Thanks for all the assistance!

                  1 Reply Last reply
                  1
                  • S Offline
                    S Offline
                    SGaist
                    Lifetime Qt Champion
                    wrote on 7 Jan 2017, 18:33 last edited by
                    #12

                    Indeed, however I did misread, the calls seem to have been done.

                    But something looks wrong since the .so files can't be found.

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

                    E 1 Reply Last reply 7 Jan 2017, 19:49
                    2
                    • S SGaist
                      7 Jan 2017, 18:33

                      Indeed, however I did misread, the calls seem to have been done.

                      But something looks wrong since the .so files can't be found.

                      E Offline
                      E Offline
                      ErranusCaminhus
                      wrote on 7 Jan 2017, 19:49 last edited by
                      #13

                      @SGaist

                      @SGaist said in MySQL + Qt 5.7 integration on Ubuntu 16.04:

                      Indeed, however I did misread, the calls seem to have been done.
                      But something looks wrong since the .so files can't be found.

                      Interesting to see what ldd on libqsqlmysql.so displays now, after creating the link:

                      guilherme@k45a:~/Programs/Qt/5.7/gcc_64/plugins/sqldrivers$ ldd libqsqlmysql.so
                      linux-vdso.so.1 => (0x00007ffe33d5f000)
                      libmysqlclient.so.20 => /usr/lib/x86_64-linux-gnu/libmysqlclient.so.20 (0x00007f8c1fcb1000)
                      libQt5Sql.so.5 => /home/guilherme/Programs/Qt/5.7/gcc_64/plugins/sqldrivers/./../../lib/libQt5Sql.so.5 (0x00007f8c1fa6c000)
                      libQt5Core.so.5 => /home/guilherme/Programs/Qt/5.7/gcc_64/plugins/sqldrivers/./../../lib/libQt5Core.so.5 (0x00007f8c1f34d000)
                      libstdc++.so.6 => /usr/lib/x86_64-linux-gnu/libstdc++.so.6 (0x00007f8c1efcb000)
                      libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007f8c1ec02000)
                      libz.so.1 => /lib/x86_64-linux-gnu/libz.so.1 (0x00007f8c1e9e7000)
                      libdl.so.2 => /lib/x86_64-linux-gnu/libdl.so.2 (0x00007f8c1e7e3000)
                      libpthread.so.0 => /lib/x86_64-linux-gnu/libpthread.so.0 (0x00007f8c1e5c6000)
                      libm.so.6 => /lib/x86_64-linux-gnu/libm.so.6 (0x00007f8c1e2bc000)
                      libgcc_s.so.1 => /lib/x86_64-linux-gnu/libgcc_s.so.1 (0x00007f8c1e0a6000)
                      libicui18n.so.56 => /home/guilherme/Programs/Qt/5.7/gcc_64/plugins/sqldrivers/./../../lib/libicui18n.so.56 (0x00007f8c1dc0b000)
                      libicuuc.so.56 => /home/guilherme/Programs/Qt/5.7/gcc_64/plugins/sqldrivers/./../../lib/libicuuc.so.56 (0x00007f8c1d853000)
                      libicudata.so.56 => /home/guilherme/Programs/Qt/5.7/gcc_64/plugins/sqldrivers/./../../lib/libicudata.so.56 (0x00007f8c1be70000)
                      libgthread-2.0.so.0 => /usr/lib/x86_64-linux-gnu/libgthread-2.0.so.0 (0x00007f8c1bc6d000)
                      librt.so.1 => /lib/x86_64-linux-gnu/librt.so.1 (0x00007f8c1ba65000)
                      libglib-2.0.so.0 => /lib/x86_64-linux-gnu/libglib-2.0.so.0 (0x00007f8c1b754000)
                      /lib64/ld-linux-x86-64.so.2 (0x000055a9c6cac000)
                      libpcre.so.3 => /lib/x86_64-linux-gnu/libpcre.so.3 (0x00007f8c1b4e3000)

                      Seems like it changed the entire dependency table.

                      1 Reply Last reply
                      0

                      13/13

                      7 Jan 2017, 19:49

                      • Login

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