[Qt-interest] static Qt with MySQL Problem

Nikos Chantziaras realnc at arcor.de
Sat Jul 9 23:00:56 CEST 2011


On 07/09/2011 11:19 PM, Sujan Dasmahapatra wrote:
> Dear Friends
> I have just configured Qt 4.7.3 statically. It was  fine. Now I am
> trying to build my mysql application with the static Qt. it gives the
> following errors.
> (.text[_gen_codes]+0x4):-1: error: undefined reference to
> `__security_cookie'
> (.text[_gen_codes]+0x6f):-1: error: undefined reference to
> `@__security_check_cookie at 4' <mailto:`@__security_check_cookie at 4'>
> (.text[_inflate_table]+0x7):-1: error: undefined reference to
> `__security_cookie'
> (.text[_inflate_table]+0xf8):-1: error: undefined reference to
> `@__security_check_cookie at 4' <mailto:`@__security_check_cookie at 4'>
> (.text[_inflate_table]+0x4e3):-1: error: undefined reference to
> `@__security_check_cookie at 4' <mailto:`@__security_check_cookie at 4'>
> :-1: error: collect2: ld returned 1 exit status
> With the normal version of Qt its compiling perfectly. But with the
> static version this throws these errors. Any help would be appreciated.
> Thanks sujan

In static builds, you need to include the plugins manually.  In your 
.pro file:

   QTPLUGIN += qsqlmysql

Then, in a .cpp source file that you link in your project (I do it in my 
main.cpp):

   #include <QtPlugin>
   Q_IMPORT_PLUGIN(qsqlmysql)



More information about the Qt-interest-old mailing list