[Solved] QFtp and qt5 linking problem
-
I have install QT 5.1.1
download from git https://qt.gitorious.org/qt/qtftpextract to:
C:\Qt\5.1.1\5.1.1\Src\qt-qtftpedit qftp.pro
@
load(qt_build_config)
Template = lib
TARGET = QtFtp
CONFIG += shared
CONFIG -= create_prl
QT = core network
CONFIG += no_install_prl
MODULE_PRI = ../../modules/qt_ftp.pri
MODULE = ftpload(qt_module)
Input
HEADERS += qftp.h qurlinfo.h
SOURCES += qftp.cpp qurlinfo.cpp"@go to VC console.
cd c:\Qt\5.1.1\5.1.1\Src\qt-qtftp\src\qftp
qmake qftp.pro
nmake
nmake installafter when I run examples from git qtftp i have this error
C:\Qt\5.1.1\5.1.1\msvc2010_opengl\examples\network\qftp\ftpwindow.cpp:43: błąd:C1083: Cannot open include file: 'QtFtp': No such file or directory
-
Could you point me step by step how to do this.
I am a beginner programmer QT.I copy qftp.h and qurlinfo.h to ftp example project,
and
add to qftp.pro
line HEADERS += qftp.h qurlinfo.hbut when i run project i have many errors like:
C:\Qt\5.1.1\5.1.1\msvc2010_opengl\examples\network\build-qftp-Desktop_Qt_5_1_1_MSVC2010_32bit_OpenGL-Debug\debug\moc_qftp.cpp:125: błąd:C2027: use of undefined type
'QFtpPrivate'
c:\qt\5.1.1\5.1.1\msvc2010_opengl\examples\network\qftp\qftp.h:51: see declaration of 'QFtpPrivate'
...first error go to
case 9: _t->d->_q_startNextCommand(); break; -
Hello
It's work- build source qt-qtftp
qmake /Src/qt-qtftp/src/src.pro
nmake
nmake install
after
change in qt-qtftp/src/qftp/qftp.pro@ CONFIG -= static
CONFIG += shared@and compile again
in lib a have now
c:\Qt\5.1.1\5.1.1\msvc2010_opengl\lib\Qt5Ftp.dll
c:\Qt\5.1.1\5.1.1\msvc2010_opengl\lib\Qt5Ftpd.dll
c:\Qt\5.1.1\5.1.1\msvc2010_opengl\lib\Qt5Ftp.lib
c:\Qt\5.1.1\5.1.1\msvc2010_opengl\lib\Qt5Ftpd.lib
c:\Qt\5.1.1\5.1.1\msvc2010_opengl\lib\Qt5Ftpd.pdb
c:\Qt\5.1.1\5.1.1\msvc2010_opengl\lib\Qt5Ftp.prl
c:\Qt\5.1.1\5.1.1\msvc2010_opengl\lib\Qt5Ftpd.prl-
create file in directory
c:\Qt\5.1.1\5.1.1\msvc2010_opengl\include\QtNetwork
QFtp
and inside add
@#include "qftp.h"@ -
copy from source two file
qftp.h and qurlinfo.h to includes\QtNetwork\ -
in my project add
@LIBS += Qt5Ftp.lib@
and
@QT += ftp@
and project finaly build and run:) jupiiii
- build source qt-qtftp
-
Thank you for sharing your solution!
-
hi,
doesn't fit 100% to the theme, but I have tried it according to the instructions, but with the Creator.
The compilation works so far. However I have 3 problems:cd qftp\ && C:\Qt\5.14.0\mingw73_32\bin\qmake.exe -o Makefile C:\Qt\qt-everywhere-src-5.14.0\qtbase\src\qtftp\examples\qftp\qftp.pro -spec win32-g++ "CONFIG+=qtquickcompiler" Project ERROR: C:/Qt/qt-everywhere-src-5.14.0/qtbase/src/qtftp/examples/qftp/qftp.pro installs target to unexpected location. mingw32-make[1]: *** [Makefile:43: sub-qftp-qmake_all] Error 3 mingw32-make[1]: Leaving directory 'C:/Qt/qt-everywhere-src-5.14.0/qtbase/src/build-qtftp-Desktop_Qt_5_14_0_MinGW_32_bit-Release/examples' mingw32-make: *** [C:/Qt/qt-everywhere-src-5.14.0/qtbase/src/build-qtftp-Desktop_Qt_5_14_0_MinGW_32_bit-Release/Makefile:71: sub-examples-qmake_all] Error 2
i simply removed module_qtftp_examples
I don't know if this is OK but now the compilation is running. And since they are only examples I think I should not have any problems.Cannot read C:/../../tests/auto/other/headersclean/headersclean.pri: No such file or directory
i have no solution for this, but i don't know if my mistakes result from this.
after compiling I only have the following files
libQt5Ftp.a
Qt5Ftp.dll
Qt5Ftp.dll.debugbut I still need
libQt5Ftpd.a
Qt5Ftpd.dll
but they're not made, so can anyone help me? -
hi,
doesn't fit 100% to the theme, but I have tried it according to the instructions, but with the Creator.
The compilation works so far. However I have 3 problems:cd qftp\ && C:\Qt\5.14.0\mingw73_32\bin\qmake.exe -o Makefile C:\Qt\qt-everywhere-src-5.14.0\qtbase\src\qtftp\examples\qftp\qftp.pro -spec win32-g++ "CONFIG+=qtquickcompiler" Project ERROR: C:/Qt/qt-everywhere-src-5.14.0/qtbase/src/qtftp/examples/qftp/qftp.pro installs target to unexpected location. mingw32-make[1]: *** [Makefile:43: sub-qftp-qmake_all] Error 3 mingw32-make[1]: Leaving directory 'C:/Qt/qt-everywhere-src-5.14.0/qtbase/src/build-qtftp-Desktop_Qt_5_14_0_MinGW_32_bit-Release/examples' mingw32-make: *** [C:/Qt/qt-everywhere-src-5.14.0/qtbase/src/build-qtftp-Desktop_Qt_5_14_0_MinGW_32_bit-Release/Makefile:71: sub-examples-qmake_all] Error 2
i simply removed module_qtftp_examples
I don't know if this is OK but now the compilation is running. And since they are only examples I think I should not have any problems.Cannot read C:/../../tests/auto/other/headersclean/headersclean.pri: No such file or directory
i have no solution for this, but i don't know if my mistakes result from this.
after compiling I only have the following files
libQt5Ftp.a
Qt5Ftp.dll
Qt5Ftp.dll.debugbut I still need
libQt5Ftpd.a
Qt5Ftpd.dll
but they're not made, so can anyone help me? -
OK,
i just tried it: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 -
@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.dllC:/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 -
@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.dllC:/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 -
@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.
@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.
-
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 :)
-
Hi and welcome to devnet,
What issues are you getting ?
-
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
-
Did you ran make install after building ?