Results 1 to 2 of 2

Thread: Using QNetworkSession/QNetworkConfiguration/QNetworkConfigurationManager

  1. #1
    Join Date
    Oct 2010
    Posts
    5
    Thanks
    1
    Thanked 1 Time in 1 Post
    Qt products
    Qt4
    Platforms
    Windows

    Default Using QNetworkSession/QNetworkConfiguration/QNetworkConfigurationManager

    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 Code:
    1. QT += core gui network
    2.  
    3. TARGET = TestBearer
    4. TEMPLATE = app
    5.  
    6. SOURCES += main.cpp\
    7. mainwindow.cpp \
    8. serverconnection.cpp
    9.  
    10. HEADERS += mainwindow.h \
    11. serverconnection.h
    12.  
    13. FORMS += mainwindow.ui
    14.  
    15. CONFIG += mobility
    16. MOBILITY = bearer
    17.  
    18. symbian {
    19. TARGET.UID3 = 0xe1b89784
    20. TARGET.CAPABILITY += NetworkServices ReadUserData
    21. TARGET.EPOCSTACKSIZE = 0x14000
    22. TARGET.EPOCHEAPSIZE = 0x020000 0x800000
    23. }
    To copy to clipboard, switch view to plain text mode 

  2. #2
    Join Date
    Mar 2009
    Location
    Brisbane, Australia
    Posts
    7,729
    Thanks
    13
    Thanked 1,610 Times in 1,537 Posts
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Windows
    Wiki edits
    17

    Default Re: Using QNetworkSession/QNetworkConfiguration/QNetworkConfigurationManager

    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 Code:
    1. QT += network
    To copy to clipboard, switch view to plain text mode 
    so the compiler will find the includes and link the libraries.

Similar Threads

  1. QNetworkConfigurationManager problem after qt build
    By Le_B in forum Installation and Deployment
    Replies: 10
    Last Post: 10th November 2010, 11:30
  2. Replies: 3
    Last Post: 2nd November 2010, 16:23

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.