首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >“错误:在此上下文中”在Qt 5中安装QFtp

“错误:在此上下文中”在Qt 5中安装QFtp
EN

Stack Overflow用户
提问于 2013-10-20 02:38:44
回答 1查看 1.3K关注 0票数 2

我刚开始使用Qt 2.8.1 (QT5.1.1)进行开发。为了实现基于ftp的应用程序,我搜索并发现在当前Qt版本中安装QFtp是必要的。所以我从https://qt.gitorious.org/qt/qtftp/下载了它。

在安装过程中,我遇到了以下问题,但到目前为止还没有找到任何解决方案。它总是说“错误:在这种情况下”:

代码语言:javascript
复制
leo@ubuntu:~$ cd Desktop/
leo@ubuntu:~/Desktop$ cd qt-qtftp/
leo@ubuntu:~/Desktop/qt-qtftp$ qmake
leo@ubuntu:~/Desktop/qt-qtftp$ make
cd src/ && make -f Makefile 
make[1]: Entering directory `/home/leo/Desktop/qt-qtftp/src'
cd qftp/ && make -f Makefile 
make[2]: Entering directory `/home/leo/Desktop/qt-qtftp/src/qftp'
g++ -c -pipe -O2 -Wall -W -D_REENTRANT -DQT_WEBKIT -DQT_NO_DEBUG -DQT_NETWORK_LIB -DQT_CORE_LIB -DQT_SHARED -I/usr/share/qt4/mkspecs/linux-g++ -I. -I/usr/include/qt4/QtCore -I/usr/include/qt4/QtNetwork -I/usr/include/qt4 -I. -o qftp.o qftp.cpp
In file included from qftp.cpp:45:0:
qftp.h: In member function ‘void QFtpPrivate::_q_startNextCommand()’:
qftp.h:144:10: error: ‘void QFtp::commandStarted(int)’ is protected
qftp.cpp:2201:33: error: within this context
In file included from qftp.cpp:45:0:
qftp.h:138:10: error: ‘void QFtp::stateChanged(int)’ is protected
qftp.cpp:2254:39: error: within this context
In file included from qftp.cpp:45:0:
qftp.h: In member function ‘void QFtpPrivate::_q_piFinished(const QString&)’:
qftp.h:145:10: error: ‘void QFtp::commandFinished(int, bool)’ is protected
qftp.cpp:2278:48: error: within this context
In file included from qftp.cpp:45:0:
qftp.h:146:10: error: ‘void QFtp::done(bool)’ is protected
qftp.cpp:2284:34: error: within this context
In file included from qftp.cpp:45:0:
qftp.h: In member function ‘void QFtpPrivate::_q_piError(int, const QString&)’:
qftp.h:145:10: error: ‘void QFtp::commandFinished(int, bool)’ is protected
qftp.cpp:2356:40: error: within this context
In file included from qftp.cpp:45:0:
qftp.h:146:10: error: ‘void QFtp::done(bool)’ is protected
qftp.cpp:2361:26: error: within this context
In file included from qftp.cpp:45:0:
qftp.h: In member function ‘void QFtpPrivate::_q_piConnectState(int)’:
qftp.h:138:10: error: ‘void QFtp::stateChanged(int)’ is protected
qftp.cpp:2371:38: error: within this context
In file included from qftp.cpp:45:0:
qftp.h: In member function ‘void QFtpPrivate::_q_piFtpReply(int, const QString&)’:
qftp.h:142:10: error: ‘void QFtp::rawCommandReply(int, const QString&)’ is protected
qftp.cpp:2384:50: error: within this context
make[2]: *** [qftp.o] Error 1
make[2]: Leaving directory `/home/leo/Desktop/qt-qtftp/src/qftp'
make[1]: *** [sub-qftp-make_default] Error 2
make[1]: Leaving directory `/home/leo/Desktop/qt-qtftp/src'
make: *** [sub-src-make_default] Error 2
EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2013-10-27 19:59:56

您是针对Qt 4构建的,但这段代码显然只是Qt5,并且依赖于Qt 5中的公共信号(它们在Qt 4中受到保护)。

查看为g++设置的包含路径:

代码语言:javascript
复制
g++ -c [...] -I/usr/include/qt4/QtCore -I/usr/include/qt4/QtNetwork -I/usr/include/qt4 -I. -o qftp.o qftp.cpp

Qt 4包括在系统范围内的安装。

我认为这是个意外,您只需在Qt中选择正确的Qt版本(QT5.1.1)。

票数 1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/19473325

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档