PDA

View Full Version : QObject / QEvent compilation problem after reinstallation?



hickscorp
8th May 2007, 22:55
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 :confused:

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? :confused:

Thanks a lot,
Pierre.

wysota
9th May 2007, 00:37
Why did you patch the code for MSVC if you compile it with another compiler? I suggest trying with a vanilla source tree.

hickscorp
10th May 2007, 16:48
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? :confused:

Thank you,
Pierre.

hickscorp
10th May 2007, 17:26
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.

marcel
10th May 2007, 18:16
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

hickscorp
10th May 2007, 18:31
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? :confused:

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 =/

marcel
10th May 2007, 18:48
Maybe you previously had some Service Pack/fix installed for VS, that you forgot about.

hickscorp
10th May 2007, 18:55
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.

hickscorp
10th May 2007, 21:50
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? :confused:
Same error happends if i "#include <QObject>", but no error if i "#include <QString>".

marcel
10th May 2007, 22:17
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

hickscorp
10th May 2007, 22:19
Yeah but well... would compiling "by the book" will deny me to compile my project with the MS compiler? =/

hickscorp
11th May 2007, 00:11
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:

#define eventFilter 'Fltr'
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:

#define photoshopEventFilter 'Fltr'
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.

wysota
11th May 2007, 00:23
"Vanilla" means "clean". If you want to compile your project with ICC, use Qt compiled for ICC, not for MSVC.