Odd Issue installing MySQL @4
While trying to install MySql v5.5 with QtSdk 4.8.1 I have tried many of the postings and instructions.
I get through the reimp and the dlltool steps, change directories, and run:
qmake -o Makefile "INCLUDEPATH+=C:/MySQL5/MySQLS~1.5/include" "LIBS+=C:/MySQL5/MySQLS~1.5/lib/opt/liblibmysql.a" mysql.pro
then:
mingw32-make
The first few steps procede normally and the I get the following messages (starting from the g++ command):
g++ -mthreads -shared -Wl,--out-implib,debug\libqsqlmysqld4.a -o debug\qsqlmysqld4.dll debug/main.o debug/qsql_mysql.o d
ebug/moc_qsql_mysql.o -L"c:\QtSDK\Desktop\Qt\4.8.1\mingw\lib" debug\qsqlmysqld_resource_res.o C:/MySQL5/MySQLS~1.5/lib/
opt/liblibmysql.a -lQtSqld4 -lQtCored4
Creating library file: debug\libqsqlmysqld4.a
debug/qsql_mysql.o: In function `codec':
C:\QtSDK\QtSources\4.8.1\src\plugins\sqldrivers\my sql/../../../sql/drivers/mysql/qsql_mysql.cpp:223: undefined reference
to `mysql_character_set_name@4'
debug/qsql_mysql.o: In function `qMakeError':
C:\QtSDK\QtSources\4.8.1\src\plugins\sqldrivers\my sql/../../../sql/drivers/mysql/qsql_mysql.cpp:234: undefined reference
to `mysql_error@4'
C:\QtSDK\QtSources\4.8.1\src\plugins\sqldrivers\my sql/../../../sql/drivers/mysql/qsql_mysql.cpp:237: undefined reference
to `mysql_errno@4'
debug/qsql_mysql.o: In function `qMakeStmtError':
C:\QtSDK\QtSources\4.8.1\src\plugins\sqldrivers\my sql/../../../sql/drivers/mysql/qsql_mysql.cpp:309: undefined reference
to `mysql_stmt_error@4'
C:\QtSDK\QtSources\4.8.1\src\plugins\sqldrivers\my sql/../../../sql/drivers/mysql/qsql_mysql.cpp:312: undefined reference
to `mysql_stmt_errno@4'
debug/qsql_mysql.o:C:\QtSDK\QtSources\4.8.1\src\plugins\ sqldrivers\mysql/../../../sql/drivers/mysql/qsql_mysql.cpp:358:
undefined reference to `mysql_stmt_result_metadata@4'
debug/qsql_mysql.o:C:\QtSDK\QtSources\4.8.1\src\plugins\ sqldrivers\mysql/../../../sql/drivers/mysql/qsql_mysql.cpp:362:
undefined reference to `mysql_num_fields@4'
debug/qsql_mysql.o:C:\QtSDK\QtSources\4.8.1\src\plugins\ sqldrivers\mysql/../../../sql/drivers/mysql/qsql_mysql.cpp:369:
undefined reference to `mysql_fetch_field@4'
debug/qsql_mysql.o:C:\QtSDK\QtSources\4.8.1\src\plugins\ sqldrivers\mysql/../../../sql/drivers/mysql/qsql_mysql.cpp:432:
undefined reference to `mysql_free_result@4'
debug/qsql_mysql.o:C:\QtSDK\QtSources\4.8.1\src\plugins\ sqldrivers\mysql/../../../sql/drivers/mysql/qsql_mysql.cpp:438:
undefined reference to `mysql_store_result@4'
debug/qsql_mysql.o:C:\QtSDK\QtSources\4.8.1\src\plugins\ sqldrivers\mysql/../../../sql/drivers/mysql/qsql_mysql.cpp:440:
undefined reference to `mysql_free_result@4'
debug/qsql_mysql.o:C:\QtSDK\QtSources\4.8.1\src\plugins\ sqldrivers\mysql/../../../sql/drivers/mysql/qsql_mysql.cpp:437:
undefined reference to `mysql_next_result@4'
debug/qsql_mysql.o:C:\QtSDK\QtSources\4.8.1\src\plugins\ sqldrivers\mysql/../../../sql/drivers/mysql/qsql_mysql.cpp:446:
undefined reference to `mysql_stmt_close@4'
debug/qsql_mysql.o:C:\QtSDK\QtSources\4.8.1\src\plugins\ sqldrivers\mysql/../../../sql/drivers/mysql/qsql_mysql.cpp:452:
undefined reference to `mysql_free_result@4'
debug/qsql_mysql.o:C:\QtSDK\QtSources\4.8.1\src\plugins\ sqldrivers\mysql/../../../sql/drivers/mysql/qsql_mysql.cpp:496:
undefined reference to `mysql_stmt_data_seek@12'
debug/qsql_mysql.o:C:\QtSDK\QtSources\4.8.1\src\plugins\ sqldrivers\mysql/../../../sql/drivers/mysql/qsql_mysql.cpp:498:
undefined reference to `mysql_stmt_fetch@4'
debug/qsql_mysql.o:C:\QtSDK\QtSources\4.8.1\src\plugins\ sqldrivers\mysql/../../../sql/drivers/mysql/qsql_mysql.cpp:513:
It continues through the entire qsql_mysql.cpp file. I'm guessing the @ is caused by unicode but I'm not sure.
I tried using Microsofts nmake and got the same error.
Any suggestions (careful...)
Jim
Re: Odd Issue installing MySQL @4
Hi,
In windows you need to link it againts the .lib file.
qmake "INCLUDEPATH+=C:\MySQL\include" "LIBS+=C:\MYSQL\MySQL Server <version>\lib\opt\libmysql.lib" mysql.pro
mingw32-make
Change the paths accordingly.
Re: Odd Issue installing MySQL @4
Hi JamesPK,
Can you tell me how did you install MySql? Did you also install connector/C etc.? I am having huge problem with installing the driver. When I run reimp -d libmysql.lib in bin/opt folder I get this error: "reimp: libmysql.lib: invalid or corrupt import library".
Also, I don't know if I am alright using 64bit Mysql with Qt which is installed in C:QtSDK. I don't know whether it is 32 or 64bit. Because mysql is 64bit so I decided to use connector/C 64 bit. However, the problem is that I cannot get through reimp, and then qmake, make etc.
Re: Odd Issue installing MySQL @4
Quote:
Originally Posted by
qlands
Hi,
In windows you need to link it againts the .lib file.
qmake "INCLUDEPATH+=C:\MySQL\include" "LIBS+=C:\MYSQL\MySQL Server <version>\lib\opt\libmysql.lib" mysql.pro
mingw32-make
Change the paths accordingly.
Thanks, but no....I completely reinstalled MySQL and Qt and get the same error whether I use the liblibmysql.a file as some instructions
suggest, or the libmysql.lib file.
Added after 5 minutes:
Quote:
Originally Posted by
ZikO
Hi JamesPK,
Can you tell me how did you install MySql? Did you also install connector/C etc.? I am having huge problem with installing the driver. When I run reimp -d libmysql.lib in bin/opt folder I get this error: "reimp: libmysql.lib: invalid or corrupt import library".
Also, I don't know if I am alright using 64bit Mysql with Qt which is installed in C:QtSDK. I don't know whether it is 32 or 64bit. Because mysql is 64bit so I decided to use connector/C 64 bit. However, the problem is that I cannot get through reimp, and then qmake, make etc.
I'm working with Windows7 (64bit). I've tried a number of variations of installing MySQL and all seemed to go through the reimp command ok. I've reinstalled using the community installer.
I tried once to install a version of MySql5 on an XP(32bit) computer and got an error msg installing. I went back to the Windows7 machine.
Re: Odd Issue installing MySQL @4
Resolved......You can't use Mysql 5.5. Mysql 5.1 works. (Maybe 64 bit vs 32 bit)
Re: Odd Issue installing MySQL @4
Hi JamesPK,
Nothing worked according to documentation. I think it is incomplete. It is so incomplete that almost useless. I lost hours or even days looking for solution to include mysql plugin--unsuccessfully. I ask a few questions here (nobody was even bothered saying anything), in Qt Project there were some people who helped, and in mysql forum (I understand people might not be of use as it is more Qt problem).
Making my mind towards building everything from sources, I have all the Qt libraries I need. I've decided to completely build Qt from sources based on Qt 4.8.2 version and MinGW 4.7.0 mainly because MinGW 4.4.x seems to be very buggy (this is what I was told in other forum). Everything is 32-bit. I've been told not to use 64-bit unless I'd have a particular reason.
I suggest to do the same if you cannot build the plugin.