PDA

View Full Version : Using QNetworkSession/QNetworkConfiguration/QNetworkConfigurationManager



mying
17th February 2011, 19:27
Hi,
I'm trying to use the QtBearer classes, but the compiler gives me an error saying "ISO C++ forbids declaration of 'QNetworkSession' with no type." I think it's unable to locate the needed files for using QtBearer, what do I change so the intellisense and compiler would recognize it?

The example project bearer could compile and run, so maybe just something missing in my pro file?



QT += core gui network

TARGET = TestBearer
TEMPLATE = app

SOURCES += main.cpp\
mainwindow.cpp \
serverconnection.cpp

HEADERS += mainwindow.h \
serverconnection.h

FORMS += mainwindow.ui

CONFIG += mobility
MOBILITY = bearer

symbian {
TARGET.UID3 = 0xe1b89784
TARGET.CAPABILITY += NetworkServices ReadUserData
TARGET.EPOCSTACKSIZE = 0x14000
TARGET.EPOCHEAPSIZE = 0x020000 0x800000
}

ChrisW67
17th February 2011, 21:53
You need to include the correct headers in the source file(s) that try to use QNetworkSession. Since QNetworkSession lives in the QtNetwork module you also need to add:


QT += network
so the compiler will find the includes and link the libraries.