Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

Unable to build libqsqlmysql.so in Ubuntu 16.04 LTS



  • Hi all
    i am trying to compile the libqsqlmysql driver because i have noticed that after the upgrade to 16.04 LTS, it misses one dependency.
    I paste the ldd output:

    	linux-vdso.so.1 =>  (0x00007ffeb86c7000)
    	libmysqlclient.so.18 => not found
    	libQt5Sql.so.5 => /home/cristiano/Qt/5.6/gcc_64/plugins/sqldrivers/./../../lib/libQt5Sql.so.5 (0x00007fbc0f8ad000)
    	libQt5Core.so.5 => /home/cristiano/Qt/5.6/gcc_64/plugins/sqldrivers/./../../lib/libQt5Core.so.5 (0x00007fbc0f19b000)
    	libstdc++.so.6 => /usr/lib/x86_64-linux-gnu/libstdc++.so.6 (0x00007fbc0ee19000)
    	libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007fbc0ea4f000)
    	libpthread.so.0 => /lib/x86_64-linux-gnu/libpthread.so.0 (0x00007fbc0e832000)
    	libm.so.6 => /lib/x86_64-linux-gnu/libm.so.6 (0x00007fbc0e529000)
    	libgcc_s.so.1 => /lib/x86_64-linux-gnu/libgcc_s.so.1 (0x00007fbc0e312000)
    	libz.so.1 => /lib/x86_64-linux-gnu/libz.so.1 (0x00007fbc0e0f8000)
    	libicui18n.so.56 => /home/cristiano/Qt/5.6/gcc_64/plugins/sqldrivers/./../../lib/libicui18n.so.56 (0x00007fbc0dc5e000)
    	libicuuc.so.56 => /home/cristiano/Qt/5.6/gcc_64/plugins/sqldrivers/./../../lib/libicuuc.so.56 (0x00007fbc0d8a5000)
    	libicudata.so.56 => /home/cristiano/Qt/5.6/gcc_64/plugins/sqldrivers/./../../lib/libicudata.so.56 (0x00007fbc0bec2000)
    	libdl.so.2 => /lib/x86_64-linux-gnu/libdl.so.2 (0x00007fbc0bcbe000)
    	libgthread-2.0.so.0 => /usr/lib/x86_64-linux-gnu/libgthread-2.0.so.0 (0x00007fbc0babb000)
    	librt.so.1 => /lib/x86_64-linux-gnu/librt.so.1 (0x00007fbc0b8b3000)
    	libglib-2.0.so.0 => /lib/x86_64-linux-gnu/libglib-2.0.so.0 (0x00007fbc0b5a2000)
    	/lib64/ld-linux-x86-64.so.2 (0x000055f82a5a1000)
    	libpcre.so.3 => /lib/x86_64-linux-gnu/libpcre.so.3 (0x00007fbc0b331000)
    
    

    After a quick search in my folder i have found that i have installed an higher version of the missing one:

    /usr/lib/x86_64-linux-gnu/libmysqlclient.so.20

    I hence have downloaded from the site the qt-base-opensource-src-5.6.0 and i have tried to compile the plugin running the following command:

    /home/cristiano/Qt/5.6/gcc_64/bin/qmake "INCLUDEPATH+=/usr/include/mysql/" "LIBS+=-L/usr/lib/x86_64-linux-gnu/ -l libmysqlclient" mysql.pro
    
    

    After running "make" i get this error:

    /usr/bin/ld: cannot find -llibmysqlclient
    /usr/bin/ld: cannot find -lmysqlclient_r
    collect2: error: ld returned 1 exit status
    Makefile:111: recipe for target '../../../../plugins/sqldrivers/libqsqlmysql.so' failed
    make: *** [../../../../plugins/sqldrivers/libqsqlmysql.so] Error 1
    
    

    What i am doing wrong???

    Thanks

    Cristiano


  • Lifetime Qt Champion

    Hi,

    Looks like you didn't install the MySQL development package.


  • Lifetime Qt Champion

    Hi,

    Looks like you didn't install the MySQL development package.


Log in to reply