Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. [Solved] QFtp and qt5 linking problem
Forum Updated to NodeBB v4.3 + New Features

[Solved] QFtp and qt5 linking problem

Scheduled Pinned Locked Moved General and Desktop
29 Posts 8 Posters 17.5k Views 3 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • D Offline
    D Offline
    Dacown
    wrote on last edited by Dacown
    #21

    @mrjj
    I have compiled the QFtp once in release mode and once in debug mode.
    I only got the files in each case:
    libQt5Ftp.a
    Qt5Ftp.dll

    C:/Qt/Tools/mingw730_32/bin/../lib/gcc/i686-w64-mingw32/7.3.0/../../../../i686-w64-mingw32/bin/ld.exe: cannot find -lQt5Ftpd
    collect2.exe: error: ld returned 1 exit status
    

    the error i get now is from a project that was running with QFtp before. i have now installed the latest QT version and wanted to include QFTP there again so i can continue using the project.
    I have tried to compile this project in debug modus

    mrjjM 1 Reply Last reply
    0
    • D Dacown

      @mrjj
      I have compiled the QFtp once in release mode and once in debug mode.
      I only got the files in each case:
      libQt5Ftp.a
      Qt5Ftp.dll

      C:/Qt/Tools/mingw730_32/bin/../lib/gcc/i686-w64-mingw32/7.3.0/../../../../i686-w64-mingw32/bin/ld.exe: cannot find -lQt5Ftpd
      collect2.exe: error: ld returned 1 exit status
      

      the error i get now is from a project that was running with QFtp before. i have now installed the latest QT version and wanted to include QFTP there again so i can continue using the project.
      I have tried to compile this project in debug modus

      mrjjM Offline
      mrjjM Offline
      mrjj
      Lifetime Qt Champion
      wrote on last edited by
      #22

      @Dacown

      You get this error when you try to use the Qt5Ftp from your app right ?

      1 Reply Last reply
      0
      • D Offline
        D Offline
        Dacown
        wrote on last edited by Dacown
        #23

        @mrjj
        yes if i try to compile it.

        I have tried now to compile QFTP on a other system.
        There it works i get the 4 files.

        Now i have test to compile my project on this machine, i have the same error.

        mrjjM 1 Reply Last reply
        0
        • D Dacown

          @mrjj
          yes if i try to compile it.

          I have tried now to compile QFTP on a other system.
          There it works i get the 4 files.

          Now i have test to compile my project on this machine, i have the same error.

          mrjjM Offline
          mrjjM Offline
          mrjj
          Lifetime Qt Champion
          wrote on last edited by
          #24

          @Dacown
          ok but if you get the dlls then
          just make sure you use the right version
          for the app.
          Release DLL for Release App
          and Debug Dll ( d in name) for Debug App
          Dont mix it.

          Also make sure the path you add to your pro file matches where you put the dll.

          1 Reply Last reply
          0
          • M Offline
            M Offline
            MEMekaniske
            wrote on last edited by
            #25

            Have been trying to get QFtp to work myself for 2 days now, think I'll just go back to the stoneage for this one app and use a very old qt with FTP..

            Have been doing amazing things with Qt.. from 3D to automation control and sensing, but this one library will have me going nuts if I don't stop trying...

            Thumbs up to everyone being able to get a usable lib out of this :)

            1 Reply Last reply
            0
            • SGaistS Offline
              SGaistS Offline
              SGaist
              Lifetime Qt Champion
              wrote on last edited by
              #26

              Hi and welcome to devnet,

              What issues are you getting ?

              Interested in AI ? www.idiap.ch
              Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

              M 1 Reply Last reply
              1
              • SGaistS SGaist

                Hi and welcome to devnet,

                What issues are you getting ?

                M Offline
                M Offline
                MEMekaniske
                wrote on last edited by MEMekaniske
                #27

                @SGaist

                Hello and thanks for the welcome :)

                First I had built a .lib with nmake and tried to include that, but i could not load any modules.
                Then I built a .a type lib, with mingw make and that would not let me load any modules either.

                I also added the qurlinfo and qftp cpp classes to my project but there was no change.
                So I gave up and removed all the linking in .pro etc.

                Today after seeing your post I included the .lib again, without removing the .a from the qtftp lib folder, also with the copied qurlinfo and qft in my project, now it actually seems to work when using it as release, the "d" libs have not been built(?).

                Only confirmation that I get that it might be working is this, maybe you can confirm if this only shows up if the modules/library are in working order or if they would show up anyway because of the included qurlinfo and qtftp classes?

                Code:

                QFtp ftp;
                       ftp.connectToHost("ftp.host.no");
                       ftp.login("username","pass");
                       qDebug() << "Ftp:";
                       qDebug() << ftp.state();
                       qDebug() << ";FTP";
                       ftp.close();
                

                Result

                Ftp:
                0
                ;FTP
                QIODevice::write (QTcpSocket, "QFtpPI_socket"): device not open
                

                If I add Qt +=ftp to .pro
                then it cannot find the module.

                Thanks

                ------- Edit -----

                I was tempted to try again, I ran qmake, mingw32-make and install, then did the changes in .pro with @ config, and ran make again,
                it has now provided dlls too. I add the library to my project with qt creator then i added ftp to my .pro, and that did not produce any fail, but it will only let me load QtFtp/QtFtpDepends?

                Also, only other change i have done other then adding @ at start and end of config, is when I had an error:
                fatal error: QtFtp/qurlinfo.h: No such file or directory
                #include <QtFtp/qurlinfo.h>

                when running the first make, so I went into src/qftp and changed in qftp.h
                #include <QtFtp/qurlinfo.h> to #include <qurlinfo.h> which solved it.
                don't know if it should have found another file which is in the mislocated folder QtFtp?

                if it is of any relevance, this is the qtftp I've downloaded https://github.com/qt/qtftp

                1 Reply Last reply
                0
                • SGaistS Offline
                  SGaistS Offline
                  SGaist
                  Lifetime Qt Champion
                  wrote on last edited by
                  #28

                  Did you ran make install after building ?

                  Interested in AI ? www.idiap.ch
                  Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

                  M 1 Reply Last reply
                  1
                  • SGaistS SGaist

                    Did you ran make install after building ?

                    M Offline
                    M Offline
                    MEMekaniske
                    wrote on last edited by MEMekaniske
                    #29

                    @SGaist

                    yes i did,

                    mingw32-make install
                    cd src\ && ( if not exist Makefile I:\Qt\5.14.0\mingw73_64\bin\qmake.exe -o Makefile C:\Users\k\Downloads\qtftp-mas\qtftp\src\src.pro ) && mingw32-make -f Makefile install
                    mingw32-make[1]: Entering directory 'C:/Users/k/Downloads/qtftp-mas/qtftp/src'
                    cd qftp\ && ( if not exist Makefile I:\Qt\5.14.0\mingw73_64\bin\qmake.exe -o Makefile C:\Users\k\Downloads\qtftp-mas\qtftp\src\qftp\qftp.pro ) && mingw32-make -f Makefile install
                    mingw32-make[2]: Entering directory 'C:/Users/k/Downloads/qtftp-mas/qtftp/src/qftp'
                    copy /y ....\lib\Qt5Ftp.dll I:\Qt\5.14.0\mingw73_64\bin\Qt5Ftp.dll
                    1 file(s) copied.
                    I:\Qt\5.14.0\mingw73_64\bin\qmake.exe -install sed -e "s,C:/Users/k/Downloads/qtftp-mas/qtftp/lib,I:/Qt/5.14.0/mingw73_64/lib,g" -e "s,C:\\Users\\k\\Downloads\\qtftp-mas\\qtftp\\lib,I:\\Qt\\5.14.0\\mingw73_64\\lib,gi" ....\lib\pkgconfig\Qt5Ftp.pc > I:\Qt\5.14.0\mingw73_64\lib\pkgconfig\Qt5Ftp.pc
                    copy /y ....\lib\libQt5Ftp.a I:\Qt\5.14.0\mingw73_64\lib\libQt5Ftp.a
                    1 file(s) copied.
                    I:\Qt\5.14.0\mingw73_64\bin\qmake.exe -install qinstall C:\Users\k\Downloads\qtftp-mas\qtftp\include\QtFtp\QtFtpDepends I:\Qt\5.14.0\mingw73_64\include\QtFtp\QtFtpDepends
                    I:\Qt\5.14.0\mingw73_64\bin\qmake.exe -install qinstall C:\Users\k\Downloads\qtftp-mas\qtftp\mkspecs\modules-inst\qt_lib_ftp.pri I:\Qt\5.14.0\mingw73_64\mkspecs\modules\qt_lib_ftp.pri
                    I:\Qt\5.14.0\mingw73_64\bin\qmake.exe -install qinstall C:\Users\k\Downloads\qtftp-mas\qtftp\mkspecs\modules-inst\qt_lib_ftp_private.pri I:\Qt\5.14.0\mingw73_64\mkspecs\modules\qt_lib_ftp_private.pri
                    I:\Qt\5.14.0\mingw73_64\bin\qmake.exe -install qinstall C:\Users\k\Downloads\qtftp-mas\qtftp\lib\cmake\Qt5Ftp\Qt5FtpConfig.cmake I:\Qt\5.14.0\mingw73_64\lib\cmake\Qt5Ftp\Qt5FtpConfig.cmake
                    I:\Qt\5.14.0\mingw73_64\bin\qmake.exe -install qinstall C:\Users\k\Downloads\qtftp-mas\qtftp\lib\cmake\Qt5Ftp\Qt5FtpConfigVersion.cmake I:\Qt\5.14.0\mingw73_64\lib\cmake\Qt5Ftp\Qt5FtpConfigVersion.cmake
                    mingw32-make[2]: Leaving directory 'C:/Users/k/Downloads/qtftp-mas/qtftp/src/qftp'
                    mingw32-make[1]: Leaving directory 'C:/Users/k/Downloads/qtftp-mas/qtftp/src'

                    the resulting lib files i get is these

                    libQt5Ftp.a
                    Qt5Ftp.dll
                    Qt5Ftp.dll.debug
                    Qt5Ftp.prl

                    .a is the one i link to, qt creator then adds this to the my project file

                    win32:CONFIG(release, debug|release): LIBS += -LC:/Users/k/Downloads/qtftp-mas/qtftp/lib/ -lQt5Ftp
                    else:win32:CONFIG(debug, debug|release): LIBS += -LC:/Users/k/Downloads/qtftp-mas/qtftp/lib/ -lQt5Ftpd
                    else:unix: LIBS += -LC:/Users/k/Downloads/qtftp-mas/qtftp/lib/ -lQt5Ftp

                    INCLUDEPATH += C:/Users/k/Downloads/qtftp-mas/qtftp
                    DEPENDPATH += C:/Users/k/Downloads/qtftp-mas/qtftp

                    edit/addon;
                    exact process was;
                    opening the qt 5.14 mingw command terminal

                    then to run qmake, which creates the stash file.
                    then i run mingw32-make after removing QtFtp/ from the include line in qftp.h,
                    then i added @ before and after config in pro and built again (if not, there is no dlls built?)
                    then i run the mingw32-make install
                    then i add the library to my project via qt creator
                    then ftp to Qt += in the .pro file (qt creator does not show any missing lib after project read anymore, so something is working)
                    but still cannot find anything else then QtFtp\QtFtpDepends

                    and if I add the qftp and qurlinfo to my project too, then i can load the QFtp class but not use it for anything it just gives me the debug:
                    QIODevice::write (QTcpSocket, "QFtpPI_socket"): device not open
                    and the state "0"

                    anyway, I think that if it was actually loading all the QFtp modules then I would not need to have qftp and qurlinfo in my project folder, just have the link to the lib?... any idea?

                    Glad that I still qualify for the indie package, because paying 5000$ each year to not even get a library or package installer is a pretty sick price... Was going to solve my problem with FTP not being availiable with just regular accessmanager put/get and use mysql for the "directory" listings, but turns out mysql is not availiable either... so only option seems to be having another computer/mcu running as a server with sqlite and then send & retrive the commands with udp/tcp.. which works, but is a pain and not efficient..

                    Finally managed to get mysql working, so i can use that for handling directory and qurl and networkaccess to do the down&uploads.
                    If someone feels like writing a up to date step by step for idiots manual on building the qftp lib i would be very happy..

                    1 Reply Last reply
                    0

                    • Login

                    • Login or register to search.
                    • First post
                      Last post
                    0
                    • Categories
                    • Recent
                    • Tags
                    • Popular
                    • Users
                    • Groups
                    • Search
                    • Get Qt Extensions
                    • Unsolved