PDA

View Full Version : Help pls with making examples (QT 4.2)



igor_x
20th October 2006, 10:47
Hi there!
I just installed QT 4.2. All example projects were compled OK after installation, but if try to
cd ../examples/network/ftp

qmake -project
qmake
gmake

i get error:

ftpwindow.cpp:25:21: QtNetwork: No such file or directory
ftpwindow.cpp: In member function `void FtpWindow::connectOrDisconnect()':
ftpwindow.cpp:88: invalid use of undefined type `struct QFtp'
ftpwindow.h:32: forward declaration of `struct QFtp'
ftpwindow.cpp:89: invalid use of undefined type `struct QFtp'
ftpwindow.h:32: forward declaration of `struct QFtp'
ftpwindow.cpp:102: invalid use of undefined type `struct QFtp'
ftpwindow.h:32: forward declaration of `struct QFtp'
ftpwindow.cpp:104: no matching function for call to `FtpWindow::connect(QFtp*&,
const char[28], FtpWindow* const, const char[31])'
../../../src/corelib/kernel/qobject.h:181: candidates are: static bool
QObject::connect(const QObject*, const char*, const QObject*, const char*,
Qt::ConnectionType = AutoConnection)
../../../src/corelib/kernel/qobject.h:283: bool
QObject::connect(const QObject*, const char*, const char*,
Qt::ConnectionType = AutoConnection) const
ftpwindow.cpp:106: no matching function for call to `FtpWindow::connect(QFtp*&,
const char[28], FtpWindow* const, const char[29])'
===
How to resolve the problem?
Thanks

jacek
20th October 2006, 11:13
With "qmake -project" you have overwritten the original .pro file. Now you have to add "QT += network" to the new .pro file to make it work.

igor_x
23rd October 2006, 12:52
Thanks!
now all work great!
And please one another question.
I tryed to install win-opensource with psql drivers, and i got error:
(i configured QT as:
configure -plugin-sql-psql -I " D:\PROGRAM FILES\postgres\include -L D:\PROGRAM FILES\postgres\lib" )

---
C:/MinGW/bin/mingw32-make.EXE -f Makefile.Debug all
mingw32-make.EXE[5]: Entering directory `C:/Qt/4.2.0/src/plugins/sqldrivers/psql
'
g++ -c -g -g -frtti -fexceptions -Wall -DUNICODE -DQT_LARGEFILE_SUPPORT -DQT_NO_
CAST_TO_ASCII -DQT_NO_CAST_FROM_ASCII -DQT_DLL -DQT_PLUGIN -DQT_SQL_LIB -DQT_COR
E_LIB -DQT_THREAD_SUPPORT -I"C:/Qt/4.2.0/include/QtCore" -I"C:/Qt/4.2.0/include/
QtCore" -I"C:/Qt/4.2.0/include/QtSql" -I"C:/Qt/4.2.0/include/QtSql" -I"C:/Qt/4.2
.0/include" -I"d:\PROGRAM" -I"FILES\postgres\include" -I"-L" -I"d:\PROGRAM" -I"F
ILES\postgres\lib" -I"C:/Qt/4.2.0/include/ActiveQt" -I"tmp\moc\debug_shared" -I"
." -I"..\..\..\..\mkspecs\win32-g++" -o tmp\obj\debug_shared\qsql_psql.o ..\..\.
.\sql\drivers\psql\qsql_psql.cpp
c:\Qt\4.2.0\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_THRE
AD_SUPPORT -I"C:/Qt/4.2.0/include/QtCore" -I"C:/Qt/4.2.0/include/QtCore" -I"C:/Q
t/4.2.0/include/QtSql" -I"C:/Qt/4.2.0/include/QtSql" -I"C:/Qt/4.2.0/include" -I"
d:\PROGRAM" -I"FILES\postgres\include" -I"-L" -I"d:\PROGRAM" -I"FILES\postgres\l
ib" -I"C:/Qt/4.2.0/include/ActiveQt" -I"tmp\moc\debug_shared" -I"." -I"..\..\..\
..\mkspecs\win32-g++" -D__GNUC__ -DWIN32 ..\..\..\sql\drivers\psql\qsql_psql.h -
o tmp\moc\debug_shared\moc_qsql_psql.cpp
g++ -c -g -g -frtti -fexceptions -Wall -DUNICODE -DQT_LARGEFILE_SUPPORT -DQT_NO_
CAST_TO_ASCII -DQT_NO_CAST_FROM_ASCII -DQT_DLL -DQT_PLUGIN -DQT_SQL_LIB -DQT_COR
E_LIB -DQT_THREAD_SUPPORT -I"C:/Qt/4.2.0/include/QtCore" -I"C:/Qt/4.2.0/include/
QtCore" -I"C:/Qt/4.2.0/include/QtSql" -I"C:/Qt/4.2.0/include/QtSql" -I"C:/Qt/4.2
.0/include" -I"d:\PROGRAM" -I"FILES\postgres\include" -I"-L" -I"d:\PROGRAM" -I"F
ILES\postgres\lib" -I"C:/Qt/4.2.0/include/ActiveQt" -I"tmp\moc\debug_shared" -I"
." -I"..\..\..\..\mkspecs\win32-g++" -o tmp\obj\debug_shared\moc_qsql_psql.o tmp
\moc\debug_shared\moc_qsql_psql.cpp
g++ -mthreads -Wl,-enable-stdcall-fixup -Wl,-enable-auto-import -Wl,-enable-runt
ime-pseudo-reloc -shared -Wl,--out-implib,c:\Qt\4.2.0\plugins\sqldrivers\libqsql
psqld.a -o "..\..\..\..\plugins\sqldrivers\qsqlpsqld.dll" tmp\obj\debug_shared\m
ain.o tmp\obj\debug_shared\qsql_psql.o tmp\obj\debug_shared\moc_qsql_psql.o -L"
c:\Qt\4.2.0\lib" -L"c:\Qt\4.2.0\lib" -lpq -lws2_32 -ladvapi32 -lQtSqld4 -lQtCore
d4
C:\MinGW\bin\..\lib\gcc\mingw32\3.4.2\..\..\..\..\ mingw32\bin\ld.exe: cannot fin
d -lpq
collect2: ld returned 1 exit status
mingw32-make.EXE[5]: *** [..\..\..\..\plugins\sqldrivers\qsqlpsqld.dll] Error 1
mingw32-make.EXE[5]: Leaving directory `C:/Qt/4.2.0/src/plugins/sqldrivers/psql'

mingw32-make.EXE[4]: *** [debug-all] Error 2
mingw32-make.EXE[4]: Leaving directory `C:/Qt/4.2.0/src/plugins/sqldrivers/psql'

mingw32-make.EXE[3]: *** [sub-psql-make_default] Error 2
mingw32-make.EXE[3]: Leaving directory `C:/Qt/4.2.0/src/plugins/sqldrivers'
mingw32-make.EXE[2]: *** [sub-sqldrivers-make_default] Error 2
mingw32-make.EXE[2]: Leaving directory `C:/Qt/4.2.0/src/plugins'
mingw32-make.EXE[1]: *** [sub-plugins-make_default] Error 2
mingw32-make.EXE[1]: Leaving directory `C:/Qt/4.2.0/src'
C:\MinGW\bin\mingw32-make.EXE: *** [sub-src-make_default-ordered] Error 2

--
Please tell me what I'm doing wrong?
Thanks!

jacek
23rd October 2006, 13:45
configure -plugin-sql-psql -I " D:\PROGRAM FILES\postgres\include -L D:\PROGRAM FILES\postgres\lib"
Copy PostgreSQL files (headers and libraries) to some other directory, so that the path doesn't contain spaces.