Installing the qtftp module in Qt 5.6.0

1.3k Views Asked by At

I'm trying to install qftp but it does not really work. I first recovered the sources on github. Then I copied the sources to Qt's src folder and renamed the "qtftp" folder, then run the Perl syncqt.pl file to generate the headers and others. Then I did a qmake, then a make.

I then copied the QFtp folder created in the qtftp include folder into the Qt include folder. Then in the .pro file of my project, I made an include of the qt_ftp.pri file created in the qtftp folder and I added QT + = ftp. I did a qmake, everything is fine. #include does not output any error.

The self completion completes nickel for Qftp. But when compiling my project I have an error of the type "undefined reference to 'Qqft :: qftp (Qobject *)". I'm stuck, I do not know what to do.

2

There are 2 best solutions below

0
On BEST ANSWER

I found the solution. You just had to modify the qt_ftp.pri file located in the \ modules folder by putting "include (.. \ mkspecs \ modules \ qt_lib_ftp.pri)" in the first line of the file

1
On

undefined reference to 'Qqft :: qftp (Qobject *) means that the linker (for some reason) cannot resolve the function call to qftp you made in your code.

  • Maybe adding QT += ftp does not cause QMake to add the QFTP-Library to the linker call in your Makefile. Have a look at your makefile if libqftp.so (or, if you are using Windows: qftp.dll) or something like this is present.
  • If the call to qftp does not come from your own code but from some other library you're using, it's possible that the order of libraries in the linker call is wrong. If a linker finds an unresolved symbol in library A, it only looks for it in the libraries mentioned after A in the linker call. If this is the case you will have to find out how you can change the order of libraries in the linker call generated by qmake.