PDA

View Full Version : Problems with Qt 4.3.4 and MySql



Headhunter_X
9th March 2008, 19:10
Hi,
i have problems to build the mysql-plugin. I have installed Qt 4.3.4, MinGW and mysql-essential-5.0.51a-win32 on Windows Vista 32-bit. I tried to build the plugin with the "Building the QMYSQL plugin on Windows using MinGW".

If i open the qt-prompt and insert:

C:\Qt\Sql\lib>reimp -d libmysql.lib

it follows the error:

[B] Cannot find -d directory [B]


Can anybody help me?

wysota
9th March 2008, 20:49
What does the -d parameter stand for? What happens if you omit it?

Headhunter_X
10th March 2008, 16:40
The -d parameter is shown in the manual "Building the QMYSQL plugin on Windows using MinGW".
But i will try it without -d.

Headhunter_X
17th March 2008, 20:23
Hi,
i have reinstalled Qt, MinGW and Sql.
I used the "Building the QMYSQL plugin on Windows using MinGW" again.
But if i insert the following line into the comand-line:

C:\Qt\Qt\src\plugins\sqldrivers\mysql>qmake -o Makefile "INCLUDEPATH+=C:\Qt\Sql\
include" "LIBS+=C:\Qt\Sql\lib\opt\liblibmysql.a" mysql.pro

I get this error:

Der Befehl "qmake" ist entweder falsch geschrieben oder
konnte nicht gefunden werden.

Can anybody say me, what i forgot?

jpn
17th March 2008, 20:39
I'm not sure if I understood the German part but looks like there is no qmake in PATH. Add C:\Qt\Qt\bin to PATH or try using the "Qt Command Prompt" (there's a shortcut in Start-menu).

Headhunter_X
18th March 2008, 16:20
Hi,
sorry i forgot to translate it. But you understand it correctly.
I have set the environment variable to C:\Qt\Qt\bin.
But i get the same error. I didn´t find the command-prompt.
Have i run the configure.exe before, to create the libaries?

jpn
18th March 2008, 17:03
I thought you said you had already installed Qt as in, installed a binary package. But anyway, yes you have to actually build Qt if you grabbed a source package. See Installing Qt/Windows (http://doc.trolltech.com/4.3/install-win.html) for more details. At the same time you can pass required options to configure script to enable MYSQL plugin. See "configure -help" for more details. Once you proceed to configure step, make sure to examine its output. You should look for something like

MYSQL support ...... plugin

Headhunter_X
18th March 2008, 20:36
Ok i configured Qt with the neccessary parameters and started again to build the sql-plugin.
I insert qmake -o Makefile....... It works.

But if i insert mingw32-make to build
qsqlmysql.dll and libqsqlmysql.a

I get this error:




C:\Qt\Qt\src\plugins\sqldrivers\mysql>mingw32-make
mingw32-make -f Makefile.Debug all
mingw32-make[1]: Entering directory `C:/Qt/Qt/src/plugins/sqldrivers/mysql'
g++ -c -g -frtti -fexceptions -mthreads -Wall -DUNICODE -DQT_LARGEFILE_SUPPORT -
DQT_NO_CAST_TO_ASCII -DQT_NO_CAST_FROM_ASCII -DQT_DLL -DQT_PLUGIN -DQT_SQL_LIB -
DQT_CORE_LIB -DQT_THREAD_SUPPORT -I"..\..\..\..\include\QtCore" -I"..\..\..\..\i
nclude\QtCore" -I"..\..\..\..\include\QtSql" -I"..\..\..\..\include\QtSql" -I"..
\..\..\..\include" -I"c:\Qt\Sql\include" -I"c:\Qt\Qt\include\ActiveQt" -I"tmp\mo
c\debug_shared" -I"." -I"..\..\..\..\mkspecs\win32-g++" -o tmp\obj\debug_shared\
main.o main.cpp
g++ -c -g -frtti -fexceptions -mthreads -Wall -DUNICODE -DQT_LARGEFILE_SUPPORT -
DQT_NO_CAST_TO_ASCII -DQT_NO_CAST_FROM_ASCII -DQT_DLL -DQT_PLUGIN -DQT_SQL_LIB -
DQT_CORE_LIB -DQT_THREAD_SUPPORT -I"..\..\..\..\include\QtCore" -I"..\..\..\..\i
nclude\QtCore" -I"..\..\..\..\include\QtSql" -I"..\..\..\..\include\QtSql" -I"..
\..\..\..\include" -I"c:\Qt\Sql\include" -I"c:\Qt\Qt\include\ActiveQt" -I"tmp\mo
c\debug_shared" -I"." -I"..\..\..\..\mkspecs\win32-g++" -o tmp\obj\debug_shared\
qsql_mysql.o ..\..\..\sql\drivers\mysql\qsql_mysql.cpp
C:/Qt/Qt/bin/moc.exe -DUNICODE -DQT_LARGEFILE_SUPPORT -DQT_NO_CAST_TO_ASCII -DQT
_NO_CAST_FROM_ASCII -DQT_DLL -DQT_PLUGIN -DQT_SQL_LIB -DQT_CORE_LIB -DQT_THREAD_
SUPPORT -I"..\..\..\..\include\QtCore" -I"..\..\..\..\include\QtCore" -I"..\..\.
.\..\include\QtSql" -I"..\..\..\..\include\QtSql" -I"..\..\..\..\include" -I"c:\
Qt\Sql\include" -I"c:\Qt\Qt\include\ActiveQt" -I"tmp\moc\debug_shared" -I"." -I"
..\..\..\..\mkspecs\win32-g++" -D__GNUC__ -DWIN32 ..\..\..\sql\drivers\mysql\qsq
l_mysql.h -o tmp\moc\debug_shared\moc_qsql_mysql.cpp
the command "C:/Qt/Qt/bin/moc.exe" is wrong
or does not exists.
mingw32-make[1]: *** [tmp/moc/debug_shared/moc_qsql_mysql.cpp] Error 1
mingw32-make[1]: Leaving directory `C:/Qt/Qt/src/plugins/sqldrivers/mysql'
mingw32-make: *** [debug-all] Error 2

wysota
18th March 2008, 21:07
You don't have Qt installed. "configure" doesn't perform the installation, it only preconfigures Qt for building. Then you have to actually build the framework. Read the associated readme file and the wiki entry or just follow the onscreen instructions.

jpn
19th March 2008, 06:17
Does C:\Qt\Qt\bin\moc.exe exist or not? I guess such confusion with "/"'s and "\"'s could be caused also by having msys/cygwin in path.