Results 1 to 5 of 5

Thread: Link problems with static MySQL plugin

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Sep 2007
    Posts
    12
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11

    Unhappy Link problems with static MySQL plugin

    I have a little app that uses the SQL module from qt. I can compile (and run) this app fine on Ubuntu (where the qt lib is apparently built without plugins).

    When I first tried my app in Gentoo, it compiled fine, but didn't find the SQL drivers during run-time (since they are compiled as plugins in Gentoo). I tried to convert my app to use the plugin approach (Added Q_IMPORT_PLUGIN to my code and QTPLUGINS to project), but now I get this error during linking:

    g++ -o ../../logind Main.cpp -L../../lib -L/usr/lib/qt4 -lsockets -lssl -lcommon -lsrp -ldotconfpp -L/usr/lib/qt4/plugins/sqldrivers/ -lqsqlmysql -lQtSql -L/usr/lib/mysql -L/usr/lib/qt4 -lQtCore -lz -lm -lrt -ldl -lpthread
    Main.o: In function `StaticqsqlmysqlPluginInstance':
    Main.cpp:71: undefined reference to `qt_plugin_instance_qsqlmysql()'
    collect2: ld returned 1 exit status
    make: *** [../../logind] Error 1
    The offending line in Main.cpp is:

    Qt Code:
    1. Q_IMPORT_PLUGIN(qsqlmysql);
    To copy to clipboard, switch view to plain text mode 

    My project file for the app is:

    Qt Code:
    1. SOURCES += Main.cpp
    2. INCLUDEPATH += ../
    3.  
    4. LIBPATH += ../../lib
    5. LIBS += -lsockets -lssl -lcommon -lsrp -ldotconfpp
    6.  
    7. QT = core sql
    8. QTPLUGIN += qsqlmysql
    9.  
    10. CONFIG += debug
    11.  
    12. TARGET = ../../logind
    To copy to clipboard, switch view to plain text mode 

    I have libqsqlmysql.so in /usr/lib/qt4/plugins/sqldrivers.

    For what it's worth, I use qt 4.3.1 and it was configured with the following:

    ./configure -stl -verbose -largefile -confirm-license -platform linux-g++ -xplatform linux-g++ -no-rpath -prefix /usr -bindir /usr/bin -libdir /usr/lib/qt4 -datadir /usr/share/qt4 -docdir /usr/share/doc/qt-4.3.1-r1 -headerdir /usr/include/qt4 -plugindir /usr/lib/qt4/plugins -sysconfdir /etc/qt4 -translationdir /usr/share/qt4/translations -examplesdir /usr/share/qt4/examples -demosdir /usr/share/qt4/demos -reduce-relocations -no-accessibility -cups -no-xinerama -opengl -no-nis -qt-gif -system-libpng -system-libjpeg -system-libtiff -system-zlib -no-libmng -release -no-separate-debug-info -plugin-sql-mysql -I/usr/include/mysql -L/usr/lib/mysql -no-sql-psql -no-sql-ibase -no-sql-sqlite -no-sql-sqlite2 -no-sql-odbc -qdbus -no-glib -no-qt3support -openssl -no-pch -no-tablet -xrender -xrandr -xkb -xshape -sm -nomake examples
    From what library should `qt_plugin_instance_qsqlmysql()' come from? Or is there something else wrong in my approach?
    Last edited by jacek; 15th September 2007 at 22:06. Reason: changed [code] to [quote]

Similar Threads

  1. Replies: 16
    Last Post: 23rd May 2008, 11:12
  2. QPluginLoader not recognizing a plugin
    By KShots in forum Qt Programming
    Replies: 3
    Last Post: 29th June 2007, 15:13
  3. Qt4 win opensource + mysql plugin
    By vr in forum Installation and Deployment
    Replies: 3
    Last Post: 25th May 2007, 10:01
  4. MySql plugin driver issues
    By stevey in forum Installation and Deployment
    Replies: 11
    Last Post: 20th September 2006, 14:45
  5. Problems building mysql plugin for Qt 4.1.2 on windows XP
    By Philip_Anselmo in forum Installation and Deployment
    Replies: 3
    Last Post: 17th May 2006, 16:38

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Qt is a trademark of The Qt Company.