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. After MySQL driver installation now also I am facing problem
Forum Updated to NodeBB v4.3 + New Features

After MySQL driver installation now also I am facing problem

Scheduled Pinned Locked Moved General and Desktop
4 Posts 2 Posters 2.1k Views 1 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.
  • C Offline
    C Offline
    codeartist
    wrote on last edited by
    #1

    Hello Friends,

    I have installed MySQL driver using following command in shell:

    @qmake "INCLUDEPATH+=/usr/include/mysql" "LIBS+=-L/usr/lib/i386-linux-gnu/libmysqlclient.a" mysql.pro
    make
    make install@

    After that It has been installed without any error. Now I want to run a program but not able to run it because it comes up with a problem:

    @./sqlexample: symbol lookup error: /home/pkr/QtSDK/Desktop/Qt/473/gcc/plugins/sqldrivers/libqsqlmysql.so: undefined symbol: mysql_server_init@

     ************CODE-ARTIST************
    
    1 Reply Last reply
    0
    • C Offline
      C Offline
      ChrisW67
      wrote on last edited by
      #2

      The plugin cannot find the named MySQL dynamic library because it is not on a standard system path (or in a path specified in LD_LIBRARY_PATH). Given the odd library path you have used while trying to build the plugin I am not surprised. MySQL on a typical 32-bit Linux will install its headers into /usr/include/mysql and libraries into /usr/lib and it will Just Work(tm). You have done something unusual to end up with the MySQL link library in a location generally used for component libraries of GCC: we can only guess at what.

      1 Reply Last reply
      0
      • C Offline
        C Offline
        codeartist
        wrote on last edited by
        #3

        Thanks for the reply Chris. However, I got my header files for mysql in /usr/include/mysql but there was no library file in /usr/lib.
        So, I tried to locate libmysqlclient.so in shell and got the path
        /usr/lib/i386-linux-gnu/
        That's why I used that path. Can you tell me if I will copy the library files from someone else PC. Can I make it work.

         ************CODE-ARTIST************
        
        1 Reply Last reply
        0
        • C Offline
          C Offline
          ChrisW67
          wrote on last edited by
          #4

          Copying files around or from another machine before you understand why it is failing is just thrashing around in the dark.

          There's nothing wrong with the library. It just appears to be in a place that is not usually on the path searched by the system for libraries.

          Before you try fixing this permanently, try running your example with this command line:
          @LD_LIBRARY_PATH=/usr/lib/i386-linux-gnu ./sqlexample@

          Does it work? If so, read the man page for ldconfig to see how to make it permanent.

          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