Results 1 to 13 of 13

Thread: QObject / QEvent compilation problem after reinstallation?

  1. #1
    Join Date
    Dec 2006
    Posts
    160
    Thanks
    33
    Thanked 1 Time in 1 Post
    Qt products
    Qt3 Qt4
    Platforms
    MacOS X Unix/X11 Windows

    Default QObject / QEvent compilation problem after reinstallation?

    Hello,

    I recently reinstalled my PC under windows (With the exact same version i had before, in fact i use a Ghost image).
    I have done the QT compilation from scratch (Re-downloaded the sources, patched it with the ACS Patch for 4.2.3, compiled as -debug-and-release for msvc.net).

    Now i'm trying to compile the very same project i was working on just before i reinstall, and i end up with 3 errors, which are located (According to the Intel compiler, i'm not using the Microsoft compiler):

    - qobject.h(108): error: expected an identifier virtual bool eventFilter(QObject *, QEvent *);
    - qdialog.h(99): error: expected an identifier bool eventFilter(QObject *, QEvent *);
    - qscrollarea.h(66): error: expected an identifier bool eventFilter(QObject *, QEvent *);
    It seems that QObject OR QEvent is unknown... or i dont know exactly what i means

    Additionnaly, i also have this error:
    - qevent.h(151): error: expected a ")" Qt::KeyboardModifiers keyState, qint64 uniqueID);
    but i had it already on my previous installation, and i was able to compile if i comment from line 148 to 151 file qevent.h (The whole "QTabletEvent" declaration had to be commented out).

    So i tried to comment the 3 previous errors from the QT source too, it compiles, but bugs at runtime.

    So, is there something special i can do, or what i maybe have been doing wrong?

    Thanks a lot,
    Pierre.

  2. #2
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,359
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: QObject / QEvent compilation problem after reinstallation?

    Why did you patch the code for MSVC if you compile it with another compiler? I suggest trying with a vanilla source tree.

  3. #3
    Join Date
    Dec 2006
    Posts
    160
    Thanks
    33
    Thanked 1 Time in 1 Post
    Qt products
    Qt3 Qt4
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: QObject / QEvent compilation problem after reinstallation?

    Well i had to patch the QT source because i compile it with the MS compiler, but my project has to be compilable with the Intel compiler also (From the Visual Studio IDE)...

    And may i ask, what is a "Vanilla" source tree?

    Thank you,
    Pierre.
    Last edited by hickscorp; 10th May 2007 at 16:27.

  4. #4
    Join Date
    Dec 2006
    Posts
    160
    Thanks
    33
    Thanked 1 Time in 1 Post
    Qt products
    Qt3 Qt4
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: QObject / QEvent compilation problem after reinstallation?

    Hello again,

    i just tried downloading the standard QT installer (The one which can download minGW), and so i changed my path regarding to the new installation.
    I have the very exact same problem when i try to compile my project from Visual Studio...

    Any help would be very appreciated, i really dont understand what's going on =/ Maybe a stupid misstake, but well... i'm unable to see it.

    Thanks,
    Pierre.
    Last edited by hickscorp; 10th May 2007 at 16:34.

  5. #5
    Join Date
    Feb 2006
    Location
    Romania
    Posts
    2,744
    Thanks
    8
    Thanked 541 Times in 521 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: QObject / QEvent compilation problem after reinstallation?

    Have you set QMAKESPEC and all the env vars correctly?
    If you compile with VS, you must set it to win32msvc*.
    If you use Intel, then you must set it to win32-icc.

    Regards

  6. #6
    Join Date
    Dec 2006
    Posts
    160
    Thanks
    33
    Thanked 1 Time in 1 Post
    Qt products
    Qt3 Qt4
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: QObject / QEvent compilation problem after reinstallation?

    Hello Marcel and thank you for your help,

    My QMAKESPEC var is set to win32-msvc.net (I use the microsoft compiler provided with Microsoft Visual Studio.net 2003 to compile QT), i only use the Intel compiler to compile my projects (Which uses the QT includes / libs).

    The thing is, right before i reinstalled my PC, i was not having those errors, but i dont remember exactly what i have done to avoid them...

    Any other clue?

    Thanks again,
    Pierre.

    [EDIT:] I'll try to compile my projects with the MS compiler too just to see, but well... it was ok before i reinstall, and i really wish i get this config back to work =/

  7. #7
    Join Date
    Feb 2006
    Location
    Romania
    Posts
    2,744
    Thanks
    8
    Thanked 541 Times in 521 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: QObject / QEvent compilation problem after reinstallation?

    Maybe you previously had some Service Pack/fix installed for VS, that you forgot about.

  8. #8
    Join Date
    Dec 2006
    Posts
    160
    Thanks
    33
    Thanked 1 Time in 1 Post
    Qt products
    Qt3 Qt4
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: QObject / QEvent compilation problem after reinstallation?

    I never had installed any update for VS, that's for sure. Anyway each time i restore my Ghost image, i run WUpdates untill there are none remaining... so any previously installed update would be there.

    No, i believe there is something i did wrong with my compilation steps (I dont remember what args i gave to ./configure the first time when it was OK)...

    I'll try to figure this out.

    Thanks anyway,
    Pierre.

  9. #9
    Join Date
    Dec 2006
    Posts
    160
    Thanks
    33
    Thanked 1 Time in 1 Post
    Qt products
    Qt3 Qt4
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: QObject / QEvent compilation problem after reinstallation?

    It's getting more and more weird...

    - I just have created a test project from scratch. A simple "Hello" widget.
    - I have used QMake to generate a project file usable with VS.
    - I was able to compile BOTH with intel and MS compilers =/

    So i have compared the options set in my project with the ones in the new test project. I have found no differences =/

    Any clue, please? I'm getting kinda lost there ^^
    Pierre.

    [EDIT:] After more testing, i removed every file related to QT from my project. It perfectly compiles, but if i just add "#include <QApplication>" anywhere in my project (But even dont instanciate any QApplication myself anywhere), i get this error:
    QtCore/../../src/corelib/kernel/qobject.h(108): error: expected an identifier
    The error points to this declaration line:
    virtual bool eventFilter(QObject *, QEvent *);
    What is this all about?
    Same error happends if i "#include <QObject>", but no error if i "#include <QString>".
    Last edited by hickscorp; 10th May 2007 at 21:00.

  10. #10
    Join Date
    Feb 2006
    Location
    Romania
    Posts
    2,744
    Thanks
    8
    Thanked 541 Times in 521 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: QObject / QEvent compilation problem after reinstallation?

    Something is deeply wrong there...
    I suggest getting a fresh copy of Qt and try compiling it "by the book". I amnot sure how to do that, but you have to do it... Best of luck!

    Regards

  11. #11
    Join Date
    Dec 2006
    Posts
    160
    Thanks
    33
    Thanked 1 Time in 1 Post
    Qt products
    Qt3 Qt4
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: QObject / QEvent compilation problem after reinstallation?

    Yeah but well... would compiling "by the book" will deny me to compile my project with the MS compiler? =/

  12. #12
    Join Date
    Dec 2006
    Posts
    160
    Thanks
    33
    Thanked 1 Time in 1 Post
    Qt products
    Qt3 Qt4
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: QObject / QEvent compilation problem after reinstallation?

    Folks, i'm proud to publically anounce that all this topic was nothingness
    Just the solution if any Photoshop developpers decide to use QT in a plugin:
    - Go to your Photoshop SDK source tree,
    - Open the file PITerminology.h, and go to line #1009 which says:
    Qt Code:
    1. #define eventFilter 'Fltr'
    To copy to clipboard, switch view to plain text mode 
    This line defines a macro called "eventFilter", which obviously is misunderstood at compile time if you're using QT...

    There is an easy workaround if you dont use event filters in your code YET, just rename the macro like this:
    Qt Code:
    1. #define photoshopEventFilter 'Fltr'
    To copy to clipboard, switch view to plain text mode 
    Then in your code (Related to Photoshop eventFilters), dont use "eventFilter" but "photoshopEventFilter" as previously defined.
    Since we're very lucky, this macro isn't actually used in any other Photoshop's SDK file.

    It will solve the very anoying errors In fact i had corrected this error a long time ago, but since i reinstalled my PC (and Photoshop SDK), it was here again... and i didnt remember.

    After i find this kind of conflict errors, am i supposed to do some feedback to TrollTech or something?

    Thanks all for your help!

    Pierre.
    [EDIT:] You can get another similar error, if you get any error which points to QTabletEvent definition in QEvent.h, you have to use the same workaround for the keyState name in PITerminology.h, or just change the "keyState" variable name in the QEvent.h.
    Last edited by hickscorp; 10th May 2007 at 23:17.

  13. #13
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,359
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: QObject / QEvent compilation problem after reinstallation?

    "Vanilla" means "clean". If you want to compile your project with ICC, use Qt compiled for ICC, not for MSVC.

Similar Threads

  1. qt4 compilation problem
    By aegis in forum Installation and Deployment
    Replies: 9
    Last Post: 22nd February 2007, 23:10
  2. qevent problem
    By amulya in forum Qt Programming
    Replies: 2
    Last Post: 13th October 2006, 11:51
  3. Problem with Destructor of QObject
    By mikro in forum Qt Programming
    Replies: 5
    Last Post: 9th July 2006, 19:05
  4. Problem and solution about QSA 1.2.0 compilation
    By Dwarf007 in forum Installation and Deployment
    Replies: 5
    Last Post: 7th March 2006, 16:52
  5. subclassing/inheritance QObject problem
    By cbeall1 in forum Qt Programming
    Replies: 12
    Last Post: 13th February 2006, 17:49

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.