PDA

View Full Version : MySQL driver installation on Qt 4.7.0



FrankN
30th November 2010, 14:45
Hey Qtcentre,

I'm currently working on an application which need acces to a MySQL database. I get the usual error with the missing driver for MySQL when trying to run the app in the simulator, and it wont run on the phone (n900) either.

I did the following:

Download and install MySQL with libraries
Run Qt. 4.7 Command prompt
cd c:\Qt\4.7.0\src\plugins\sqldrivers\mysql
qmake "INCLUDEPATH+=C:\\program files\\MySQL\\MySQL Server 5.1\\include" "LIBS+=C:\\program files\\MySQL\MySQL Server 5.1\\lib\\opt\\libmysql.lib" mysql.pro
nmake

Everything works until i write nmake, where i get the following error:
'nmake' is not recognized as an internal or externa......
I tried make and mingw32-make which gave the same error.

I then saw a different approach, and tried to edit the path in environment variables under systems to c:\Qt\4.7.0\bin, but didn't understand the part about adding the destination to the compiler. (what compiler and where?)

Im quite a neewb, so i'll appreciate anything easy to understand;)

Timoteo
30th November 2010, 17:19
'nmake' is not recognized as an internal or externa......
I tried make and mingw32-make which gave the same error.
First you need to figure out what your environment actually is. Are you using Visual Studio or MinGW? You saying this:

I then tried to download nmake which didn't work on my 64 bit W7.
makes me smile. Are you serious?:)

FrankN
30th November 2010, 17:39
Thank you for your reply!



First you need to figure out what your environment actually is. Are you using Visual Studio or MinGW? You saying this:
To be honest i don't know, i just started programming. A guide online told me to write mingw32-make if nmake wouldn't work.


makes me smile. Are you serious?:)
I'm glad i made you smile:D But yes, i was serious:o I also saw this in an online guide which i might have misunderstood!

Timoteo
30th November 2010, 17:49
Do you even have a development environment setup? From the path you show as being your Qt install, it would seem you have the libraries for Visual Studio 2008 installed.

FrankN
8th December 2010, 15:33
Hey, i now have a development environment (i think). It runs make, but now i get the following error:

http://i52.tinypic.com/bdmqdk.png

Thanks in advance:)

Timoteo
8th December 2010, 18:14
Did you actually use the MySQL Server installer? Are those files actually there? If not, run the installer and select a custom install. Choose the development files.

FrankN
8th December 2010, 19:17
Did you actually use the MySQL Server installer? Are those files actually there? If not, run the installer and select a custom install. Choose the development files.

Yes, i did use the MySQL Server Installer, and selected the custom installer to choose the development files. The files seems to be there (i checked libmysql.lib). qsql_mysql.h is also in it's location.
Is there any other files to look for?

Thanks very much for your help!! It's much appreciated!

Timoteo
8th December 2010, 19:36
Ahh, looking at your output again I see something else. \Program Files\ has a space in the path. I would relocate the headers and the lib to a directory without a space (i.e. C:\MySQL\).

FrankN
9th December 2010, 10:07
Ahh, looking at your output again I see something else. \Program Files\ has a space in the path. I would relocate the headers and the lib to a directory without a space (i.e. C:\MySQL\).


Hey, i tried to install mysql in another directory without spaces. It seems like it was the solution to solve the error. Unfortunately, i got another error insted.

I got his error:
http://i53.tinypic.com/2gv8txf.png

I read another guide telling me to first reimp libmysql.lib. I did this and instead used the liblibmysql.a but got this error:

http://i56.tinypic.com/i5tyk5.png

bmn
13th December 2010, 07:44
anyone? :)