PDA

View Full Version : ActiveQT G++ Error



CHeader
20th February 2008, 05:04
Hi everybody,

There are some compiling errors from mingw32-make after done qmake -makefile, mingw32-make.exe does the follow output:


g++ -c -O2 -frtti -fexceptions -mthreads -Wall -DUNICODE -DQT_LARGEFILE_SUPPORT
-DQT_NO_DEBUG -DQT_XML_LIB -DQT_GUI_LIB -DQT_NETWORK_LIB -DQT_CORE_LIB -DQT_THRE
AD_SUPPORT -I"c:\Qt\4.3.3\include\QtCore" -I"c:\Qt\4.3.3\include\QtCore" -I"c:\Q
t\4.3.3\include\QtNetwork" -I"c:\Qt\4.3.3\include\QtNetwork" -I"c:\Qt\4.3.3\incl
ude\QtGui" -I"c:\Qt\4.3.3\include\QtGui" -I"c:\Qt\4.3.3\include\QtXml" -I"c:\Qt\
4.3.3\include\QtXml" -I"c:\Qt\4.3.3\include" -I"..\lol\include" -I"..\liblol"
-I"c:\Qt\4.3.3\include\ActiveQt" -I"release" -I"." -I"c:\Qt\4.3.3\mkspecs\win32-
g++" -o release\conversationdialog.o conversationdialog.cppmingw32-make.exe does give the follow information on the file:


conversationdialog.cpp: In member function `virtual void ConversationDialog::notifyUser()':
conversationdialog.cpp:150: error: `FLASHWINFO' undeclared (first use this function)
conversationdialog.cpp:150: error: (Each undeclared identifier is reported only once for each function it appears in.)
conversationdialog.cpp:150: error: expected `;' before "info"
conversationdialog.cpp:151: error: `info' undeclared (first use this function)
conversationdialog.cpp:156: error: `::FlashWindowEx' has not been declared

The source file conversationdialog.cpp is included as attechment in this post, I've tried some define's and typedefs and declared codes but nothing helps.

Who could help solve my compiling problem? Thank you!
*

jpn
20th February 2008, 07:59
Try using QApplication::alert() instead of FlashWindowEx().

CHeader
20th February 2008, 19:24
I do follow your post but there is a little grammical mistake in my english (I do not fully understand english, However. Here is how I suppose the code must be)


void ConversationDialog::notifyUser()
{
#ifdef Q_WS_WIN
QApplication::alert info;
ZeroMemory(&info, sizeof(info));
info.cbSize = sizeof(info);
info.hwnd = winId();
info.dwFlags = 15;
info.uCount = 3;
QApplication::alert(&info);
#endif
user->playNotification();
}

jpn
20th February 2008, 19:34
Forget about such info struct and take a look at QApplication::alert() docs. It should be:

QApplication::alert(this); // infinite alert on this window
or

QApplication::alert(this, 3000); // alert on this window for 3 secs

CHeader
20th February 2008, 19:39
Okay, I fully understand. The docs on trolltech does not give mutch information about this usage. But If i remove all codes within #ifdef Q_WS_WIN till #endif and replace that with:



#ifdef Q_WS_WIN
QApplication::alert(&info, 3000);
#endifThen it will return no error's?

jpn
20th February 2008, 19:43
Then it will return no error's?
Why don't you compile and see yourself that it won't compile. QApplication::alert() takes a pointer to the window. I already gave you working code...

CHeader
20th February 2008, 22:07
Why don't you compile and see yourself that it won't compile. QApplication::alert() takes a pointer to the window. I already gave you working code...

Oh haha, I overlooked my nose. When compiling with your example I get the follow error: conversationdialog.cpp:158: error: incomplete type `QApplication' used in nested name specifier..

Line 158 is now: QApplication::alert(this, 5000);

The complete function is:

void ConversationDialog::notifyUser()
{
#ifdef Q_WS_WIN
// Compiler gives error here, so comment out FLASHWINFO!
// FLASHWINFO info;
// ZeroMemory(&info, sizeof(info));
// info.cbSize = sizeof(info);
// info.hwnd = winId();
// info.dwFlags = 15;
// info.uCount = 3;
// ::FlashWindowEx(&info);
QApplication::alert(this, 5000);
#endif
user->playNotification();
}

I see nowhere defined 'this' but 'info' was defined as FLASHWINFO info;? Could I define this as QAPPLICATION this; ?

jpn
21st February 2008, 07:12
When compiling with your example I get the follow error: conversationdialog.cpp:158: error: incomplete type `QApplication' used in nested name specifier..
#include <QApplication>


I see nowhere defined 'this' but 'info' was defined as FLASHWINFO info;? Could I define this as QAPPLICATION this; ?
You should consult your favourite C++ book on "this pointer".