PDA

View Full Version : MySQL driver - Very strange problem. PLEASE HELP ME. Thanks.



diego
1st June 2009, 08:42
Hi all.
I am trying to connect Mysql with QT on Window XP.
I made steps:
1. Installed QT SDK
2. Installed MySQL
3. I run Qt Command Prompt to Build the QMYSQL Plugin on Windows.

cd %QTDIR%\src\plugins\sqldrivers\mysql
qmake "INCLUDEPATH+=C:\Program Files\MySQL\MySQL Server 5.0\include" "LIBS+=C:\Program Files\MySQL\MySQL Server 5.0\lib\opt\libmysql.lib" mysql.pro
make
(follow QTdocuments) (http://doc.trolltech.com/4.5/sql-driver.html#how-to-build-the-qmysql-plugin-on-windows)

it appears me a very strange message :


...
In file included from main.cpp:44:
../../../sql/drivers/mysql/qsql_mysql.h:52:19: mysql.h: No such file or directory
In file included from main.cpp:44:
../../../sql/drivers/mysql/qsql_mysql.h:107: error: expected `)' before '*' token
make[1]: *** [debug/main.o] Error 1
make[1]: Leaving directory `C:/Qt/2009.02/qt/src/plugins/sqldrivers/mysql'
make: *** [debug] Error 2


What happends with me? Please help me.

Thanks.
Diego.

zio_tom78
2nd June 2009, 08:25
I ran in a similar problem just yesterday, trying to compile the PostgreSQL driver. It is likely the spaces in "Program Files" and "MySQL Server 5.0" are confusing qmake/make/Windows. Try to run "qmake" this way:

qmake "INCLUDEPATH+=\"C:\Program Files\MySQL\MySQL Server 5.0\include\"" "LIBS+=\"C:\Program Files\MySQL\MySQL Server 5.0\lib\opt\libmysql.lib\"" mysql.pro

(i.e. put \" around the paths). In my case this did the trick.

tgreaves
2nd June 2009, 15:57
Try this..

cd %QTDIR%\src\plugins\sqldrivers\mysql
qmake "INCLUDEPATH+='C:\Program Files\MySQL\MySQL Server 5.0\include'" "LIBS+='C:\Program Files\MySQL\MySQL Server 5.0\lib\opt\libmysql.lib'" mysql.pro
make