×

Discussion Board

Results 1 to 2 of 2

Hybrid View

  1. #1
    Registered User
    Join Date
    Jan 2009
    Location
    Italy
    Posts
    12

    Red face QHttp problem: "has initializer but incomplete type"

    Hi,
    I'm new in QT development and I'm trying do write a simple application to connect to a network.
    Here's the code:
    Code:
    #include <QApplication>
    #ifdef Q_OS_SYMBIAN
    #include <QDir>
    #include <QDesktopWidget> 
    #include <QtNetwork>
    #include <QHttp>
    #include <QUrl>
    #include <QFile>
    #endif
    
    QT_BEGIN_NAMESPACE
    class QUrl;
    class QHttpRequestHeader;
    class QHttp;
    class QUrlInfo;
    QT_END_NAMESPACE
    
    #if defined Q_OS_SYMBIAN && defined SETDEFAULTIF_AVAILABLE
    #include <es_sock.h>
    #include <sys/socket.h>
    #include <net/if.h>
    
    static void setDefaultIapL()
    {
        TInt err = KErrNone;
        RSocketServ serv;
        CleanupClosePushL(serv);
        User::LeaveIfError(serv.Connect());
    
        RConnection conn;   
        CleanupClosePushL(conn);     
        User::LeaveIfError(conn.Open(serv));    
        User::LeaveIfError(conn.Start());
         
        _LIT(KIapNameSetting, "IAP\\Name");
        TBuf8<50> iapName;
        User::LeaveIfError(conn.GetDesSetting(TPtrC(KIapNameSetting), iapName));   
        
        struct ifreq ifReq; 
        strcpy( ifReq.ifr_name, (char*)iapName.Ptr()); 
        User::LeaveIfError(setdefaultif( &ifReq ));
        
        CleanupStack::PopAndDestroy(&conn);
        CleanupStack::PopAndDestroy(&serv);
    }
    
    static int setDefaultIap()
    {
        TRAPD(err, setDefaultIapL());
        return err;
    }
    
    #endif
    
    
    int main(int argc, char *argv[])
    {
    #ifdef Q_OS_SYMBIAN
    #ifdef SETDEFAULTIF_AVAILABLE
        setDefaultIap();
    #endif    
    
    #endif
    	QApplication a(argc, argv);
        QFile file("index.php");
        QHttp http("www.google.it"); //*
        http.get("/index.php", &file);
    	a.connect(&http, SIGNAL(done(bool)), &a, SLOT(quit()));
    	return a.exec();
    
    }
    But I've got the following error:
    'QHttp http' has initializer but incomplete type
    Someone can help me?

  2. #2
    Super Contributor
    Join Date
    Oct 2007
    Location
    જુનાગઢ - India
    Posts
    3,034

    Re: QHttp problem: "has initializer but incomplete type"

    Make sure your macro "Q_OS_SYMBIAN" is defined. Else compiler will not get defination of QHttp and will gives error.

Similar Threads

  1. SyncML link problem
    By samuel_ in forum Symbian
    Replies: 4
    Last Post: 2009-03-27, 08:02
  2. Problem MMC+USB Connection
    By Fede81 in forum Symbian
    Replies: 1
    Last Post: 2007-06-14, 06:13
  3. Problem MMC+USB Connection
    By Fede81 in forum General Development Questions
    Replies: 3
    Last Post: 2006-07-19, 15:21
  4. Linux driver in RedHat 7.3
    By nsolhjoo in forum Multimodecards
    Replies: 0
    Last Post: 2003-10-24, 17:04

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
×