[PyQt] Problems with MySQL module

Andreas Pakulat apaku at gmx.de
Mon Sep 3 01:18:18 BST 2007

On 02.09.07 19:54:57, Gustavo A. Díaz wrote:
> Ok, first:

Thanks, that looks good.

> Second (i believe this is what you asked...):


> Checking to see if the QtSql module should be built...
> g++ -DQT_NO_DEBUG -DQT_SQL_LIB -I. -I/usr/mkspecs/linux-g++
> -I/usr/include/qt4/QtSql -I/usr/include/qt4/QtGui -I/usr/include/qt4
> -I/usr/X11R6/include -pipe -O2 -w -D_REENTRANT cfgtest_QtSql.cpp -o
> cfgtest_QtSql -L/usr/lib -L/usr/X11R6/lib -Wl,-rpath,/usr/lib -lQtSql
> -L/usr/lib -L/usr/lib -lpq -L/usr/lib/mysql -lmysqlclient_r -lsqlite
> -lsqlite3 -lQtCore -L/usr/lib -lfontconfig -lz -lm -pthread -lgthread-2.0-lrt -
> lglib-2.0 -lpthread -ldl -lQtGui -L/usr/lib -L/usr/X11R6/lib -laudio -lXt
> -lpng -lSM -lICE -lQtCore -L/usr/lib -lz -pthread -lgthread-2.0 -lrt -
> lglib-2.0 -lpthread -lXi -lXrender -lXrandr -lXfixes -lXcursor -lXinerama
> -lfreetype -lfontconfig -lXext -lX11 -lm -ldl -lXext -lX11 -lm -lpthread
> /usr/bin/ld: cannot find -lsqlite3
> collect2: ld devolvió el estado de salida 1
> Fro some reason now that changed, it shows -lsqlite3

Are you sure that changed, without you installing something extra (like
a mysqlclient-dev package)? Anyway, see below.

>, but i would not use sqlite module...
>  i just need mysql module. Still, does not enable mysql module for
> compile...

Well, that you don't want the sqlite support doesn't matter here.
Installing the sqlite-dev packages will make it link.

The question is why sqlite3, sqlite and mysqlclient show up in that
linker line at all. Usually a program linking to QtSql shouldn't need to
link against the depencies of QtSql explicitly, so I guess the configure
script does a bit "too much" here. Phil?

Another way to reduce the deps of your QtSql module would be by building
Qt4 yourself and disabling sqlite support completely.


You have the body of a 19 year old.  Please return it before it gets wrinkled.

More information about the PyQt mailing list