QT error: invalid use of incomplete type 'class QNetworkProxy'
-
Hi there, I am currently having a problem like the following.
src/qt/optionsmodel.cpp: In member function 'bool OptionsModel::getProxySettings(QNetworkProxy&) const':
src/qt/optionsmodel.cpp:342:18: error: invalid use of incomplete type 'class QNetworkProxy'
proxy.setType(QNetworkProxy::Socks5Proxy);
^
In file included from src/qt/optionsmodel.cpp:4:0:
src/qt/optionsmodel.h:14:7: error: forward declaration of 'class QNetworkProxy'
class QNetworkProxy;
^
src/qt/optionsmodel.cpp:342:27: error: incomplete type 'QNetworkProxy' used in nested name specifier
proxy.setType(QNetworkProxy::Socks5Proxy);
^
src/qt/optionsmodel.cpp:343:18: error: invalid use of incomplete type 'class QNetworkProxy'
proxy.setHostName(QString::fromStdString(curProxy.first.ToStringIP()));
^
In file included from src/qt/optionsmodel.cpp:4:0:
src/qt/optionsmodel.h:14:7: error: forward declaration of 'class QNetworkProxy'
class QNetworkProxy;
^
src/qt/optionsmodel.cpp:344:18: error: invalid use of incomplete type 'class QNetworkProxy'
proxy.setPort(curProxy.first.GetPort());
^
In file included from src/qt/optionsmodel.cpp:4:0:
src/qt/optionsmodel.h:14:7: error: forward declaration of 'class QNetworkProxy'
class QNetworkProxy;
^
src/qt/optionsmodel.cpp:352:14: error: invalid use of incomplete type 'class QNetworkProxy'
proxy.setType(QNetworkProxy::NoProxy);
^
In file included from src/qt/optionsmodel.cpp:4:0:
src/qt/optionsmodel.h:14:7: error: forward declaration of 'class QNetworkProxy'
class QNetworkProxy;
^
src/qt/optionsmodel.cpp:352:23: error: incomplete type 'QNetworkProxy' used in nested name specifier
proxy.setType(QNetworkProxy::NoProxy);Actually the line #include <QNetworkProxy> has been already existing in optionsmodel.cpp.
And in optionsmodel.h, the following lines are already existing.
QT_BEGIN_NAMESPACE
class QNetworkProxy;
QT_END_NAMESPACEIt's an open source project, so I thought that it will be built without any error. But unfortunately it occurs the error and I am not sure how to fix it because I am not familiar with QT.
My QT version is 5.8.Can you please let me know how I can overcome this problem?
Thanks. -
Hi and welcome to devnet,
Did you forget the include statement in your
optionsmodel.cpp file
?
If not, did you also addQT += network
in your .pro file ? -
Hi SGaist, thanks for your reply.
As I mentioned, #include <QNetworkProxy> was already added in the .cpp file.
And, QT += core gui widgets network printsupport was also added in the .pro file.I am really not sure why it can't be compiled. Actually I am not a QT developer, so I have no idea how I can overcome this.
Can you please give me any hint? -
My bad, I misread that part.
Did you re-run qmake after adding network to the
QT
variable and before building your project ?By the way, the framework's name is Qt, QT stands for Apple's QuickTime.
-
Actually I have re-ran qmake many many times, but all are failed in that part.
It is an open source project, so I thought that it will be worked exactly without any error.
You can see it on Github: https://github.com/martexcoin/martexcoin
And the files are:
[https://github.com/martexcoin/martexcoin/blob/master/src/qt/optionsmodel.h](link url)
[https://github.com/martexcoin/martexcoin/blob/master/src/qt/optionsmodel.cpp](link url)Project file is: [https://github.com/martexcoin/martexcoin/blob/master/martex.pro](link url)
The steps to build that I have tried:
qmake martex.pro -r -spec win32-g++ "CONFIG+=release" USE_UPNP=0 USE_QRCODE=1 USE_IPV6=1
make clean
cd src/leveldb
make TARGET_OS=OS_WINDOWS_CROSSCOMPILE clean
make TARGET_OS=OS_WINDOWS_CROSSCOMPILE libleveldb.a libmemenv.a
cd ../..
make releaseI think that all dependencies are setup correctly.
-
@SGaist , maybe if you have any spare time, can we do Skype? I can share my screen, so you will be able to what is going now.
Of course I am willing to compensate you for this problem. Please let me know your Skype ID if you agree, or you can find me: Anatoly.Halfin.RSH