Cannot install QFTP! Please help!



  • Hi,
    This is the 3rd day of me searching for a solution. I have recently installed qt5 after reading all those pages telling me how fabulous it is. To my surprize QFtp has been removed. I'm not sure if I understand why qftp was removed considering there is no equivalent (QNetworkAccessManager is not a equivalent, try and remove a file through an FTP connection with it).

    Yesterday it turns out that QFtp is still available, but it needs to be downloaded and installed seperately. So I downloaded the source code. And now I'm pretty much stuck. I was sure I read somewhere that QT has the most help when it comes to helping people to learn. It turns out I must be wrong because the only actual solution I could find during the last 3 days was this:
    http://qt-project.org/forums/viewthread/24466

    After reading the replies from that thread, I did the following:
    downloaded QFTP from : https://qt.gitorious.org/qt/qtftp

    extracted in my C:\Qt\Qt5.1.0\QFtp

    opened the QT Command prompt by searching QT in the start menu.

    navigated to the directory where i extracted QFtp

    run qmake and got this warning
    C:/Qt/Qt5.1.0/QFtp/mkspecs/modules/qt_lib_ftp.pri:9: WARNING: Include file C:/Qt/mkspecs/modules-inst/qt_lib_ftp.pri not found

    run mingw32-make and got this output:
    @cd src\ && ( if not exist Makefile C:\Qt\Qt5.1.0\5.1.0\mingw48_32\bin\qmake.exe
    C:\Qt\Qt5.1.0\QFtp\src\src.pro -o Makefile ) && mingw32-make -f Makefile
    mingw32-make[1]: Entering directory 'C:/Qt/Qt5.1.0/QFtp/src'
    cd qftp\ && ( if not exist Makefile C:\Qt\Qt5.1.0\5.1.0\mingw48_32\bin\qmake.exe
    C:\Qt\Qftp\src\qftp\qftp.pro -o Makefile ) && mingw32-make -f Makefile
    mingw32-make[2]: Entering directory 'C:/Qt/Qt5.1.0/QFtp/src/qftp'
    C:\Qt\Qt5.1.0\5.1.0\mingw48_32\bin\qmake.exe -o Makefile qftp.pro
    C:/Qt/Qt5.1.0/QFtp/mkspecs/modules/qt_lib_ftp.pri:9: WARNING: Include file C:/Qt
    /mkspecs/modules-inst/qt_lib_ftp.pri not found
    mingw32-make[2]: Leaving directory 'C:/Qt/Qt5.1.0/QFtp/src/qftp'
    mingw32-make[2]: Entering directory 'C:/Qt/Qt5.1.0/QFtp/src/qftp'
    mingw32-make -f Makefile.Release all
    mingw32-make[3]: Entering directory 'C:/Qt/Qt5.1.0/QFtp/src/qftp'
    mingw32-make[3]: Nothing to be done for 'all'.
    mingw32-make[3]: Leaving directory 'C:/Qt/Qt5.1.0/QFtp/src/qftp'
    mingw32-make -f Makefile.Debug all
    mingw32-make[3]: Entering directory 'C:/Qt/Qt5.1.0/QFtp/src/qftp'
    mingw32-make[3]: Nothing to be done for 'all'.
    mingw32-make[3]: Leaving directory 'C:/Qt/Qt5.1.0/QFtp/src/qftp'
    mingw32-make[2]: Leaving directory 'C:/Qt/Qt5.1.0/QFtp/src/qftp'
    mingw32-make[1]: Leaving directory 'C:/Qt/Qt5.1.0/QFtp/src'@@@

    run mingw32-make install and got this output:
    @cd src\ && ( if not exist Makefile C:\Qt\Qt5.1.0\5.1.0\mingw48_32\bin\qmake.exe
    C:\Qt\Qt5.1.0\QFtp\src\src.pro -o Makefile ) && mingw32-make -f Makefile install

    mingw32-make[1]: Entering directory 'C:/Qt/Qt5.1.0/QFtp/src'
    cd qftp\ && ( if not exist Makefile C:\Qt\Qt5.1.0\5.1.0\mingw48_32\bin\qmake.exe
    C:\Qt\Qftp\src\qftp\qftp.pro -o Makefile ) && mingw32-make -f Makefile install
    mingw32-make[2]: Entering directory 'C:/Qt/Qt5.1.0/QFtp/src/qftp'
    mingw32-make -f Makefile.Release install
    mingw32-make[3]: Entering directory 'C:/Qt/Qt5.1.0/QFtp/src/qftp'
    copy /y "....\lib\Qt5Ftp.prl" "C:\Qt\Qt5.1.0\5.1.0\mingw48_32\lib\Qt5Ftp.prl"
    1 file(s) copied.
    copy /y "....\lib\pkgconfig\Qt5Ftp.pc" "C:\Qt\Qt5.1.0\5.1.0\mingw48_32\lib\pkgc
    onfig\Qt5Ftp.pc"
    1 file(s) copied.
    copy /y "....\lib\libQt5Ftp.a" "C:\Qt\Qt5.1.0\5.1.0\mingw48_32\lib\libQt5Ftp.a"

        1 file(s) copied.
    

    copy /y C:\Qt\Qt5.1.0\QFtp\include\QtFtp\QtFtpDepends C:\Qt\Qt5.1.0\5.1.0\mingw
    48_32\include\QtFtp
    1 file(s) copied.
    copy /y C:\Qt\Qt5.1.0\QFtp\mkspecs\modules-inst\qt_lib_ftp.pri C:\Qt\Qt5.1.0\5.
    1.0\mingw48_32\mkspecs\modules
    1 file(s) copied.
    copy /y C:\Qt\Qt5.1.0\QFtp\lib\cmake\Qt5Ftp\Qt5FtpConfig.cmake C:\Qt\Qt5.1.0\5.
    1.0\mingw48_32\lib\cmake\Qt5Ftp
    1 file(s) copied.
    copy /y C:\Qt\Qt5.1.0\QFtp\lib\cmake\Qt5Ftp\Qt5FtpConfigVersion.cmake C:\Qt\Qt5.
    1.0\5.1.0\mingw48_32\lib\cmake\Qt5Ftp
    1 file(s) copied.
    mingw32-make[3]: Leaving directory 'C:/Qt/Qt5.1.0/QFtp/src/qftp'
    mingw32-make -f Makefile.Debug install
    mingw32-make[3]: Entering directory 'C:/Qt/Qt5.1.0/QFtp/src/qftp'
    copy /y "....\lib\Qt5Ftpd.prl" "C:\Qt\Qt5.1.0\5.1.0\mingw48_32\lib\Qt5Ftpd.prl"

        1 file(s) copied.
    

    copy /y "....\lib\pkgconfig\Qt5Ftp.pc" "C:\Qt\Qt5.1.0\5.1.0\mingw48_32\lib\pkgc
    onfig\Qt5Ftp.pc"
    1 file(s) copied.
    copy /y "....\lib\libQt5Ftpd.a" "C:\Qt\Qt5.1.0\5.1.0\mingw48_32\lib\libQt5Ftpd.
    a"
    1 file(s) copied.
    copy /y C:\Qt\Qt5.1.0\QFtp\include\QtFtp\QtFtpDepends C:\Qt\Qt5.1.0\5.1.0\mingw
    48_32\include\QtFtp
    1 file(s) copied.
    copy /y C:\Qt\Qt5.1.0\QFtp\mkspecs\modules-inst\qt_lib_ftp.pri C:\Qt\Qt5.1.0\5.
    1.0\mingw48_32\mkspecs\modules
    1 file(s) copied.
    copy /y C:\Qt\Qt5.1.0\QFtp\lib\cmake\Qt5Ftp\Qt5FtpConfig.cmake C:\Qt\Qt5.1.0\5.
    1.0\mingw48_32\lib\cmake\Qt5Ftp
    1 file(s) copied.
    copy /y C:\Qt\Qt5.1.0\QFtp\lib\cmake\Qt5Ftp\Qt5FtpConfigVersion.cmake C:\Qt\Qt5.
    1.0\5.1.0\mingw48_32\lib\cmake\Qt5Ftp
    1 file(s) copied.
    mingw32-make[3]: Leaving directory 'C:/Qt/Qt5.1.0/QFtp/src/qftp'
    mingw32-make[2]: Leaving directory 'C:/Qt/Qt5.1.0/QFtp/src/qftp'
    mingw32-make[1]: Leaving directory 'C:/Qt/Qt5.1.0/QFtp/src'@

    opened my project and included QT += ftp

    run qmake in my project

    tried to build and run but got this error
    C:\Users\Dachckol\Dropbox\programs\c++\QT\CWMods\CWMods\ftpwritter.h:13: error: QFtp: No such file or directory

    Please tell me how to actually install QFtp and please provide me with details. Tell me exactly what to do instead of things like "build and install QFtp".
    Thank You,


  • Moderators

    welcome to devnet

    You try to reintegrate QFtp to Qt again. This might be possible. However, IMHO a bit questionable.

    Basically you can use the source and create your library (just for QFtp and QUrl) and link it to your application as you would compile and link your own libraries. If you do a dynamic link lib, you should be fine with licensing as well.



  • Thanks for the reply.
    Your way sounds easier, could you tell me how I would do that?
    My application is dynamically linked.


  • Moderators

    You need to pull the full source for QtFtp from git. There is already some examples and tests available. Those help you to get the stuff compiled.

    I have basically created a new project for a dll in order to find the different settings and I need to add.

    src/qftp/qftp.h
    @

    -40,19 +40,22

    ****************************************************************************/

    #ifndef QFTP_H
    #define QFTP_H

    +#include "dlllib_global.h"

    #include <QtCore/qstring.h>
    #include "qurlinfo.h"
    #include <QtCore/qobject.h>

    QT_BEGIN_HEADER

    class QFtpPrivate;

    -class QFtp : public QObject

    +class DLLLIBSHARED_EXPORT QFtp : public QObject
    {
    Q_OBJECT

    public:
    explicit QFtp(QObject *parent = 0);
    @

    src/qftp/qftp.pro
    @

    -1,15 +1,15

    load(qt_build_config)

    TARGET = QtFtp
    -CONFIG += static
    -CONFIG -= shared
    QT = core network

    MODULE_PRI = ../../modules/qt_ftp.pri
    MODULE = ftp

    load(qt_module)

    +DEFINES += DLLLIB_LIBRARY

    Input

    HEADERS += qftp.h qurlinfo.h
    SOURCES += qftp.cpp qurlinfo.cpp
    @

    src/qftp/qurlinfo.h
    [code]

    -40,10 +40,12

    ****************************************************************************/

    #ifndef QURLINFO_H
    #define QURLINFO_H

    +#include "dlllib_global.h"

    #include <QtCore/qdatetime.h>
    #include <QtCore/qstring.h>
    #include <QtCore/qiodevice.h>

    QT_BEGIN_HEADER

    -52,11 +54,11

    QT_BEGIN_NAMESPACE

    class QUrl;
    class QUrlInfoPrivate;

    -class QUrlInfo
    +class DLLLIBSHARED_EXPORT QUrlInfo
    {
    public:
    enum PermissionSpec {
    ReadOwner = 00400, WriteOwner = 00200, ExeOwner = 00100,
    ReadGroup = 00040, WriteGroup = 00020, ExeGroup = 00010,
    [/code]

    There are only a few lines to change in the code. These are differences shown in GIT for the files.

    Here is dllllib_global.h

    @
    #ifndef DLLLIB_GLOBAL_H
    #define DLLLIB_GLOBAL_H

    #include <QtCore/qglobal.h>

    #if defined(DLLLIB_LIBRARY)

    define DLLLIBSHARED_EXPORT Q_DECL_EXPORT

    #else

    define DLLLIBSHARED_EXPORT Q_DECL_IMPORT

    #endif

    #endif // DLLLIB_GLOBAL_H
    @


  • Moderators

    In case you have a bit trouble to read the difference files:

    in src/qftp/qftp.h add
    @
    #include "dlllib_global.h"
    @

    change
    @
    class QFtp : public QObject
    @
    to
    @
    class DLLLIBSHARED_EXPORT QFtp : public QObject
    @

    In src/qftp/qftp.pro remove
    @
    CONFIG += static
    CONFIG -= shared
    @ and add
    @
    DEFINES += DLLLIB_LIBRARY
    @

    in src/qftp/qurlinfo.h add
    @
    #include "dlllib_global.h"
    @

    change
    @
    class QUrlInfo
    @ to
    @
    class DLLLIBSHARED_EXPORT QUrlInfo
    @



  • Ok, ive downloaded the qftp again. Extracted and made those changes and additions. I've never made a liblary before, can you tell me how to actually get the .dll now. Building the project gives me quite a few errors such as:
    C:\Qt\Qt5.1.0\QFtp\tests\auto\headersclean\headersclean.pro:2: error: WARNING: Include file /../../tests/auto/other/headersclean/headersclean.pri not found


  • Moderators

    Go to the examples project and rerun qmake in Qt creator and make a rebuild. Actually the tests I have never created, I did basically build for those parts required only.
    I did it the other week and forgot most of it already.
    Just did rerun of qmake for tests.pro. This is somehow not complete. I get the same error.
    Rerun qmake on "src.pro" and "examples.pro" that did the trick in my case.



  • Ok, thank you very much for your help.


Log in to reply
 

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.