Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Installation and Deployment
  4. how to compile mysql plugin for Qt5.7 in centos 7.5
QtWS25 Last Chance

how to compile mysql plugin for Qt5.7 in centos 7.5

Scheduled Pinned Locked Moved Solved Installation and Deployment
7 Posts 2 Posters 1.6k 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
    rahulvishwakarma
    wrote on last edited by
    #1

    hi to all,
    I've centos 6.4 as server and centos 7.5 as client . I've Qt 5.7 in client and mysql server in centos 6.4 . I want to compile mysql sql plugin. I ran following commands and got following error:-

    [rahul@centos75client mysql]$ /opt/Qt/5.7/gcc_64/bin/qmake "INCLUDEPATH+=/usr/include/mysql" "LIBS+=-L/usr/lib64/mysql -lmysqlclient_r -lrt -ldl" mysql.pro
    [rahul@centos75client 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 -lrt -ldl -lmysqlclient_r -lz -lcrypt -lnsl -lm -lssl -lcrypto -L/opt/Qt/5.7/gcc_64/lib -lQt5Sql -lQt5Core -lpthread  
    /usr/bin/ld: cannot find -lz
    /usr/bin/ld: cannot find -lssl
    /usr/bin/ld: cannot find -lcrypto
    collect2: error: ld returned 1 exit status
    make: *** [../../../../plugins/sqldrivers/libqsqlmysql.so] Error 1
    

    i installed following rpms for lz lssl lcrypto :-

       1:sslscan-1.10.2-3.el7             
       2:perl-Newt-1.08-36.el7    
       3:crypto-utils-2.4.1-42.el7
       4:tlssled-1.3-4.el7                
       5:lz4-1.7.5-2.el7 
    

    but having same problem.
    how to compile mysql plugin. please help

    1 Reply Last reply
    0
    • SGaistS Offline
      SGaistS Offline
      SGaist
      Lifetime Qt Champion
      wrote on last edited by
      #2

      Hi,

      You need to install the development package of these libraries.

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

        @rahulvishwakarma said in how to compile mysql plugin for Qt5.7 in centos 7.5:
        i only found "lz4-devel-1.7.5-2.el7.x86_64.rpm" . for above rpms. I googled so many times but having empty hands.

        1 Reply Last reply
        0
        • SGaistS Offline
          SGaistS Offline
          SGaist
          Lifetime Qt Champion
          wrote on last edited by
          #4

          What about https://pkgs.org/download/openssl-devel ?

          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
            rahulvishwakarma
            wrote on last edited by
            #5

            thanks for reply, i installed all rpms and with all dependencies. and at last i hang up with this error :-

            [root@centos75client mysql]# /opt/Qt/5.9.7/gcc_64/bin/qmake "INCLUDEPATH+=/usr/include" "LIBS+=-L/usr/lib64/mysql -lmysqlclient_r -lrt -ldl" mysql.pro 
            Cannot read /opt/Qt/5.9.7/Src/qtbase/src/plugins/sqldrivers/qtsqldrivers-config.pri: No such file or directory
            Project ERROR: Library 'mysql' is not defined.
            

            how to solve this.

            1 Reply Last reply
            0
            • SGaistS Offline
              SGaistS Offline
              SGaist
              Lifetime Qt Champion
              wrote on last edited by
              #6

              What about following what is shown in the Qt MySQL driver documentation ?

              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
                rahulvishwakarma
                wrote on last edited by rahulvishwakarma
                #7

                i installed all these dependent rpms :-

                   1:libgcc-4.8.5-36.el7              ################################# [  1%]
                   2:libverto-devel-0.2.5-4.el7       ################################# [  2%]
                   3:pcre-devel-8.32-17.el7           ################################# [  2%]
                   4:nss-softokn-freebl-3.34.0-2.el7  ################################# [  3%]
                   5:glibc-common-2.17-260.el7        ################################# [  4%]
                   6:glibc-2.17-260.el7               ################################# [  5%]
                   7:nspr-4.17.0-1.el7                ################################# [  5%]
                   8:nss-util-3.34.0-2.el7            ################################# [  6%]
                   9:libsepol-2.5-10.el7              ################################# [  7%]
                  10:libstdc++-4.8.5-36.el7           ################################# [  8%]
                  11:pcre-8.32-17.el7                 ################################# [  9%]
                  12:libselinux-2.5-14.1.el7          ################################# [  9%]
                  13:libcom_err-1.42.9-13.el7         ################################# [ 10%]
                  14:zlib-1.2.7-18.el7                ################################# [ 11%]
                  15:nss-pem-1.0.3-4.el7              ################################# [ 12%]
                  16:nss-3.34.0-4.el7                 ################################# [ 13%]
                  17:nspr-devel-4.17.0-1.el7          ################################# [ 13%]
                  18:libitm-4.8.5-28.el7              ################################# [ 14%]
                  19:nss-util-devel-3.34.0-2.el7      ################################# [ 15%]
                  20:opencryptoki-libs-3.7.0-1.el7    ################################# [ 16%]
                  21:libcom_err-devel-1.42.9-13.el7   ################################# [ 16%]
                  22:nss-tools-3.34.0-4.el7           ################################# [ 17%]
                  23:glib2-2.56.1-2.el7               ################################# [ 18%]
                  24:zlib-devel-1.2.7-18.el7          ################################# [ 19%]
                  25:nspr-4.19.0-1.el7_5              ################################# [ 20%]
                  26:sqlite-3.7.17-8.el7              ################################# [ 20%]
                  27:nss-util-3.36.0-1.el7_5          ################################# [ 21%]
                  28:libsepol-devel-2.5-10.el7        ################################# [ 22%]
                  29:libselinux-devel-2.5-14.1.el7    ################################# [ 23%]
                  30:nss-softokn-freebl-3.34.0-2.el7  ################################# [ 23%]
                  31:nss-softokn-freebl-devel-3.34.0-2################################# [ 24%]
                  32:bzlib-1:1.0.6-alt6               ################################# [ 25%]
                  33:daxctl-libs-62-1.el7             ################################# [ 26%]
                  34:lz4-1.7.5-2.el7                  ################################# [ 27%]
                  35:perl-Newt-1.08-36.el7            ################################# [ 27%]
                  36:perl-WWW-Curl-4.15-13.el7        ################################# [ 28%]
                  37:nss-softokn-freebl-devel-3.34.0-2################################# [ 29%]
                  38:nspr-4.17.0-1.el7                ################################# [ 30%]
                  39:nss-util-3.34.0-2.el7            ################################# [ 30%]
                  40:keyutils-libs-1.5.8-3.el7        ################################# [ 31%]
                  41:krb5-libs-1.15.1-34.el7          ################################# [ 32%]
                  42:openssl-libs-1:1.0.2k-12.el7     ################################# [ 33%]
                  43:cyrus-sasl-lib-2.1.26-23.el7     ################################# [ 34%]
                  44:openldap-2.4.44-13.el7           ################################# [ 34%]
                  45:libitm-4.8.5-28.el7              ################################# [ 35%]
                  46:openssl-libs-1:1.0.2k-12.el7     ################################# [ 36%]
                  47:keyutils-libs-devel-1.5.8-3.el7  ################################# [ 37%]
                  48:krb5-devel-1.15.1-18.el7         ################################# [ 38%]
                  49:opencryptoki-libs-3.7.0-1.el7    ################################# [ 38%]
                  50:ncurses-libs-5.9-14.20130511.el7_################################# [ 39%]
                  51:libdb-5.3.21-24.el7              ################################# [ 40%]
                  52:cyrus-sasl-lib-2.1.26-23.el7     ################################# [ 41%]
                  53:libuuid-2.23.2-59.el7            ################################# [ 41%]
                  54:libitm-devel-4.8.5-28.el7        ################################# [ 42%]
                  55:opencryptoki-icsftok-3.7.0-1.el7 ################################# [ 43%]
                  56:libkadm5-1.15.1-34.el7           ################################# [ 44%]
                  57:openssl-1:1.0.2k-12.el7          ################################# [ 45%]
                  58:libblkid-2.23.2-59.el7           ################################# [ 45%]
                  59:readline-6.2-10.el7              ################################# [ 46%]
                  60:sqlite-3.7.17-8.el7              ################################# [ 47%]
                  61:nss-softokn-3.34.0-2.el7         ################################# [ 48%]
                  62:nss-softokn-devel-3.34.0-2.el7   ################################# [ 48%]
                  63:nss-pem-1.0.3-4.el7              ################################# [ 49%]
                  64:nss-3.34.0-4.el7                 ################################# [ 50%]
                  65:openldap-2.4.44-13.el7           ################################# [ 51%]
                  66:libgpg-error-1.12-3.el7          ################################# [ 52%]
                  67:libgcrypt-1.5.3-14.el7           ################################# [ 52%]
                  68:xz-libs-5.2.2-1.el7              ################################# [ 53%]
                  69:cyrus-sasl-2.1.26-23.el7         ################################# [ 54%]
                  70:cyrus-sasl-devel-2.1.26-23.el7   ################################# [ 55%]
                  71:openldap-servers-2.4.44-13.el7   ################################# [ 55%]
                  72:krb5-libs-1.15.1-37.el7_6        ################################# [ 56%]
                  73:openssl-libs-1:1.0.2k-16.el7     ################################# [ 57%]
                  74:sslscan-1.10.2-3.el7             ################################# [ 58%]
                  75:krb5-devel-1.15.1-18.el7         ################################# [ 59%]
                  76:openssl-devel-1:1.0.2k-12.el7    ################################# [ 59%]
                  77:openssl-devel-1:1.0.2k-12.el7    ################################# [ 60%]
                  78:cracklib-2.9.0-11.el7            ################################# [ 61%]
                  79:elfutils-libelf-0.172-2.el7      ################################# [ 62%]
                  80:elfutils-libs-0.172-2.el7        ################################# [ 63%]
                  81:libattr-2.4.46-13.el7            ################################# [ 63%]
                  82:libcap-2.22-9.el7                ################################# [ 64%]
                  83:libcap-ng-0.7.5-4.el7            ################################# [ 65%]
                  84:audit-libs-2.8.4-4.el7           ################################# [ 66%]
                  85:pam-1.1.8-22.el7                 ################################# [ 66%]
                  86:cyrus-sasl-2.1.26-23.el7         ################################# [ 67%]
                  87:cyrus-sasl-devel-2.1.26-23.el7   ################################# [ 68%]
                  88:lz4-1.7.5-2.el7                  ################################# [ 69%]
                  89:openldap-devel-2.4.44-13.el7     ################################# [ 70%]
                  90:openssl-static-1:1.0.2k-12.el7   ################################# [ 70%]
                  91:openssl-devel-1:1.0.2k-16.el7    ################################# [ 71%]
                  92:openssl-static-1:1.0.2k-12.el7   ################################# [ 72%]
                  93:tlssled-1.3-4.el7                ################################# [ 73%]
                  94:libkadm5-1.15.1-37.el7_6         ################################# [ 73%]
                  95:openldap-servers-sql-2.4.44-13.el################################# [ 74%]
                  96:openldap-devel-2.4.44-13.el7     ################################# [ 75%]
                  97:cryptsetup-libs-2.0.3-3.el7      ################################# [ 76%]
                  98:nss-devel-3.34.0-4.el7           ################################# [ 77%]
                  99:nss-devel-3.34.0-4.el7           ################################# [ 77%]
                 100:sqlite-devel-3.7.17-8.el7        ################################# [ 78%]
                 101:openssl-perl-1:1.0.2k-12.el7     ################################# [ 79%]
                 102:krb5-devel-1.15.1-34.el7         ################################# [ 80%]
                 103:opencryptoki-3.7.0-1.el7         ################################# [ 80%]
                 104:libitm-static-4.8.5-28.el7       ################################# [ 81%]
                 105:libitm-static-4.8.5-28.el7       ################################# [ 82%]
                 106:opencryptoki-devel-3.7.0-1.el7   ################################# [ 83%]
                 107:openldap-clients-2.4.44-13.el7   ################################# [ 84%]
                 108:crypto-utils-2.4.1-42.el7        ################################# [ 84%]
                 109:lz4-devel-1.7.5-2.el7            ################################# [ 85%]
                 110:ndctl-libs-62-1.el7              ################################# [ 86%]
                 111:nss-softokn-devel-3.34.0-2.el7   ################################# [ 87%]
                 112:sqlite-devel-3.7.17-8.el7        ################################# [ 88%]
                 113:gamin-0.1.10-16.el7              ################################# [ 88%]
                 114:glib2-devel-2.56.1-2.el7         ################################# [ 89%]
                 115:opencryptoki-devel-3.7.0-1.el7   ################################# [ 90%]
                 116:libitm-devel-4.8.5-28.el7        ################################# [ 91%]
                 117:nss-util-devel-3.34.0-2.el7      ################################# [ 91%]
                 118:nspr-devel-4.17.0-1.el7          ################################# [ 92%]
                 119:systemd-libs-219-62.el7          ################################# [ 93%]
                 120:device-mapper-7:1.02.149-8.el7   ################################# [ 94%]
                 121:device-mapper-libs-7:1.02.149-8.e################################# [ 95%]
                 122:parted-3.1-29.el7                ################################# [ 95%]
                 123:opencryptoki-icsftok-3.7.0-1.el7 ################################# [ 96%]
                 124:libmount-2.23.2-59.el7           ################################# [ 97%]
                 125:opencryptoki-3.7.0-1.el7         ################################# [ 98%]
                 126:nss-softokn-freebl-3.36.0-5.el7_5################################# [ 98%]
                 127:libffi-3.0.13-18.el7             ################################# [ 99%]
                 128:libverto-0.2.5-4.el7             ################################# [100%]
                

                and after running qmake and make like this:-

                [root@centos75client mysql]# /opt/Qt/5.7/gcc_64/bin/qmake "INCLUDEPATH+=/usr/include" "LIBS+=-L/usr/lib64/mysql -lmysqlclient_r -lrt -ldl -lssl -lcrypto" mysql.pro 
                [root@centos75client 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 -lrt -ldl -lmysqlclient_r -lz -lcrypt -lnsl -lm -lssl -lcrypto -L/opt/Qt/5.7/gcc_64/lib -lQt5Sql -lQt5Core -lpthread  
                mv -f libqsqlmysql.so ../../../../plugins/sqldrivers/ 
                [root@centos75client mysql]# make install
                install -m 755 -p ../../../../plugins/sqldrivers/libqsqlmysql.so /opt/Qt/5.7/gcc_64/plugins/sqldrivers/libqsqlmysql.so
                strip --strip-unneeded /opt/Qt/5.7/gcc_64/plugins/sqldrivers/libqsqlmysql.so
                install -m 644 -p /opt/Qt/5.7/Src/qtbase/lib/cmake/Qt5Sql/Qt5Sql_QMYSQLDriverPlugin.cmake /opt/Qt/5.7/gcc_64/lib/cmake/Qt5Sql/
                

                and mysql plugin installed

                thanks alot

                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