Results 1 to 2 of 2

Thread: QtTest problem compiling basic testcase

  1. #1
    Join Date
    Dec 2009
    Posts
    62
    Thanks
    6
    Qt products
    Qt4
    Platforms
    Windows

    Default QtTest problem compiling basic testcase

    Hi

    I was trying to use QtTest for the first time with a simple example from the internet.

    This is the code:

    #include <QtTest>
    #include <QtCore>

    class TestQString: public QObject
    {
    Q_OBJECT
    private slots:
    void toUpper();
    };

    void TestQString::toUpper()
    {
    QString str = "Hello";
    //COMPARE(str.toUpper(), QString("HELLO"));
    }

    QTTEST_MAIN(TestQString)
    #include "testqstring.moc"


    However when compiling I just get the errors below, all of them pointing at this line:
    QT_BEGIN_MOC_NAMESPACE
    static const uint qt_meta_data_TestQString[] = {

    Errors:

    \debug\testqstring.moc(19) : error C3646: 'uint' : unknown override specifier
    \debug\testqstring.moc(19) : error C3646: 'qt_meta_data_TestQString' : unknown override specifier
    \debug\testqstring.moc(19) : error C2090: function returns array
    \debug\testqstring.moc(19) : error C2270: 'QTTEST_MAIN' : modifiers not allowed on nonmember functions
    \debug\testqstring.moc(19) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
    1\debug\testqstring.moc(19) : error C2072: 'QTTEST_MAIN' : initialization of a function
    debug\testqstring.moc(22) : error C2078: too many initializers
    \debug\testqstring.moc(44) : error C2065: 'qt_meta_data_TestQString' : undeclared identifier

  2. #2
    Join Date
    Dec 2009
    Posts
    62
    Thanks
    6
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: QtTest problem compiling basic testcase

    *bump*

    no one has encountered this problem. ?

Similar Threads

  1. Error while compiling a new basic project
    By sudheer168 in forum Qt Programming
    Replies: 1
    Last Post: 17th August 2009, 08:25
  2. Error while compiling a new basic project
    By sudheer168 in forum Installation and Deployment
    Replies: 0
    Last Post: 17th August 2009, 07:34
  3. QT 4.5 + .config problem with Basic XLib?
    By qoo in forum Installation and Deployment
    Replies: 4
    Last Post: 5th August 2009, 11:52
  4. basic qt opengl problem
    By kingslee in forum Qt Programming
    Replies: 4
    Last Post: 12th November 2006, 15:26
  5. Basic: problem building designer application
    By kingslee in forum Qt Tools
    Replies: 2
    Last Post: 31st August 2006, 15:26

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.