[Qt-interest] subclassing Sql drivers (linking issue)

Andre Somers andre at familiesomers.nl
Mon Feb 22 17:44:04 CET 2010


Andre Somers wrote:
> Hi,
>
> I am trying to extend the Qt SQL drivers to add some functionality. I 
> have the thing compiling, but I run into a problem when linking. I get 
> lots of "undefined reference" errors like these:
>
> C:/projects/srtools/common/ExtendedDatabaseDrivers/accessdriver.cpp:124: 
> undefined reference to `QODBCDriver::open(QString const&, QString 
> const&, QString const&, QString const&, int, QString const&)'
>
> for all the methods that I subclassed (or are done so by moc). Yes, I 
> have included the Q_OBJECT macro.
>
> This particular driver is trying to extend the QODBCDriver to specialize 
> it for using with Microsoft Access. T
> The issue *seems* to be that if I include the sql module, I am not there 
> yet. I guess I have to link to the driver lib itself in some way, but I 
> don't really see how. However, I may be off the mark.
>
> Any hints are appreciated.
>
> André
>   
I tried adding the drivers lib to the libs to link with like this:
LIBS += -lqsqlodbc4 -L$$[QT_INSTALL_PLUGINS]/sqldrivers

However, that did not fix the issue.

André




More information about the Qt-interest-old mailing list