Add QFtp in Qt 5.0

2019-05-18 07:28发布

问题:

I need to use the QFtp class in my project.

As I develop with Qt 5.0, I have needed to download the class from the gitorious repository : https://qt.gitorious.org/qt/qtftp

When I try to compile the project, I have these errors :

19:45:25: Exécution des étapes pour le projet qtftp...
19:45:25: Configuration inchangée, étape QMake sautée.
19:45:25: Débute : "C:\Qt\Qt5.0.1\Tools\MinGW\bin\mingw32-make.exe" 
cd src\ && ( if not exist Makefile C:\Qt\Qt5.0.1\5.0.1\mingw47_32\bin\qmake.exe C:\Qt\Qt5.0.1\src\qt-qtftp\src\src.pro -o Makefile ) && C:/Qt/Qt5.0.1/Tools/MinGW/bin/mingw32-make -f Makefile 
mingw32-make[1]: Entering directory 'C:/Qt/Qt5.0.1/src/qt-qtftp/src'
cd qftp\ && ( if not exist Makefile C:\Qt\Qt5.0.1\5.0.1\mingw47_32\bin\qmake.exe C:\Qt\Qt5.0.1\src\qt-qtftp\src\qftp\qftp.pro -o Makefile ) && C:/Qt/Qt5.0.1/Tools/MinGW/bin/mingw32-make -f Makefile 
'perl.exe' n'est pas reconnu en tant que commande interne ou externe, un programme executable ou un fichier de commandes.
Project MESSAGE: C:\Qt\Qt5.0.1\5.0.1\mingw47_32\bin\syncqt.bat -module QtFtp -mkspecsdir C:\Qt\Qt5.0.1\5.0.1\mingw47_32/mkspecs -outdir C:/Qt/Qt5.0.1/src/qt-qtftp C:/Qt/Qt5.0.1/src/qt-qtftp
Project ERROR: Failed to run: C:\Qt\Qt5.0.1\5.0.1\mingw47_32\bin\syncqt.bat -module QtFtp -mkspecsdir C:\Qt\Qt5.0.1\5.0.1\mingw47_32/mkspecs -outdir C:/Qt/Qt5.0.1/src/qt-qtftp C:/Qt/Qt5.0.1/src/qt-qtftp
Makefile:38: recipe for target 'sub-qftp-make_first' failed
mingw32-make[1]: *** [sub-qftp-make_first] Error 3
mingw32-make[1]: Leaving directory 'C:/Qt/Qt5.0.1/src/qt-qtftp/src'
makefile:40: recipe for target 'sub-src-make_first' failed
mingw32-make: *** [sub-src-make_first] Error 2
19:45:27: Le processus "C:\Qt\Qt5.0.1\Tools\MinGW\bin\mingw32-make.exe" s'est terminé avec le code 2.
Error while building/deploying project qtftp (kit: Desktop Qt 5.0.1 MinGW 32bit)

回答1:

Download, compile and install that add-on; then in your application's .pro file use

QT += ftp

to make the QFtp class available.



标签: ftp qt5