How to fix 'LINK : fatal error LNK1181: cannot open input file 'Qt5Ftp.obj''?

742 views Asked by At

I use Qt5.12.0, Qt Creator 4.8.0. So it doesn't contain QFtp but I need to use it. So I follow the way I found on the Internet, I put the .h, .lib, .prl, .dll files of Qt5Ftp to the corresponding directories in 'Qt\Qt5.12.0\5.12.0\msvc2017_64'. Then I built my project, the compiling process is successful, but there's an error in the linking process—

LINK : fatal error LNK1181: cannot open input file 'Qt5Ftp.obj'

I'd tried to rerun qmake, clean all, rebuild all, etc, everything I could try, but I still got this error.

Here's the content of the .pro file of my project—

QT       += core gui network webenginewidgets
CONFIG   += c++11

greaterThan(QT_MAJOR_VERSION, 4): QT += widgets

include(qtsingleapplication/src/qtsingleapplication.pri)

TARGET = YunQuBrowser
TEMPLATE = app

DEFINES += QT_DEPRECATED_WARNINGS

SOURCES += main.cpp\
        mainwindow.cpp \
    webview.cpp \
    webpage.cpp \
    ftpclient.cpp \
    logfile.cpp \
    cmdconfig.cpp

HEADERS  += mainwindow.h \
    webview.h \
    webpage.h \
    ftpclient.h \
    logfile.h \
    cmdconfig.h \
    common.h

INCLUDEPATH += ./include

FORMS    += mainwindow.ui

RESOURCES += \
    YunQuBrowser.qrc \

RC_FILE = YunQuBrowserDesktopIcon.rc

CONFIG(debug, debug|release) {
    LIBS += Qt5Ftpd
} else {
    LIBS += Qt5Ftp
}
1

There are 1 answers

0
Yadid On BEST ANSWER

The last comment I post contains a mistake. The correct way is to change the whole CONFIG block into LIBS += -L"QFtp/qtftp_lib", which should be a directory, but not a path of a .lib file.