Results 1 to 8 of 8

Thread: ActiveQT G++ Error

  1. #1

    Default ActiveQT G++ Error

    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.cpp
    mingw32-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!
    *
    Attached Files Attached Files

  2. #2
    Join Date
    Feb 2006
    Location
    Oslo, Norway
    Posts
    6,264
    Thanks
    36
    Thanked 1,519 Times in 1,389 Posts
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows Symbian S60 Maemo/MeeGo

    Default Re: ActiveQT G++ Error

    Try using QApplication::alert() instead of FlashWindowEx().
    J-P Nurmi

  3. #3

    Default Re: ActiveQT G++ Error

    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)

    Qt Code:
    1. void ConversationDialog::notifyUser()
    2. {
    3. #ifdef Q_WS_WIN
    4. QApplication::alert info;
    5. ZeroMemory(&info, sizeof(info));
    6. info.cbSize = sizeof(info);
    7. info.hwnd = winId();
    8. info.dwFlags = 15;
    9. info.uCount = 3;
    10. QApplication::alert(&info);
    11. #endif
    12. user->playNotification();
    13. }
    To copy to clipboard, switch view to plain text mode 

  4. #4
    Join Date
    Feb 2006
    Location
    Oslo, Norway
    Posts
    6,264
    Thanks
    36
    Thanked 1,519 Times in 1,389 Posts
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows Symbian S60 Maemo/MeeGo

    Default Re: ActiveQT G++ Error

    Forget about such info struct and take a look at QApplication::alert() docs. It should be:
    Qt Code:
    1. QApplication::alert(this); // infinite alert on this window
    To copy to clipboard, switch view to plain text mode 
    or
    Qt Code:
    1. QApplication::alert(this, 3000); // alert on this window for 3 secs
    To copy to clipboard, switch view to plain text mode 
    J-P Nurmi

  5. #5

    Default Re: ActiveQT G++ Error

    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:


    Qt Code:
    1. #ifdef Q_WS_WIN
    2. QApplication::alert(&info, 3000);
    3. #endif
    To copy to clipboard, switch view to plain text mode 
    Then it will return no error's?

  6. #6
    Join Date
    Feb 2006
    Location
    Oslo, Norway
    Posts
    6,264
    Thanks
    36
    Thanked 1,519 Times in 1,389 Posts
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows Symbian S60 Maemo/MeeGo

    Default Re: ActiveQT G++ Error

    Quote Originally Posted by CHeader View Post
    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...
    J-P Nurmi

  7. #7

    Default Re: ActiveQT G++ Error

    Quote Originally Posted by jpn View Post
    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:
    Qt Code:
    1. void ConversationDialog::notifyUser()
    2. {
    3. #ifdef Q_WS_WIN
    4. // Compiler gives error here, so comment out FLASHWINFO!
    5. // FLASHWINFO info;
    6. // ZeroMemory(&info, sizeof(info));
    7. // info.cbSize = sizeof(info);
    8. // info.hwnd = winId();
    9. // info.dwFlags = 15;
    10. // info.uCount = 3;
    11. // ::FlashWindowEx(&info);
    12. QApplication::alert(this, 5000);
    13. #endif
    14. user->playNotification();
    15. }
    To copy to clipboard, switch view to plain text mode 

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

  8. #8
    Join Date
    Feb 2006
    Location
    Oslo, Norway
    Posts
    6,264
    Thanks
    36
    Thanked 1,519 Times in 1,389 Posts
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows Symbian S60 Maemo/MeeGo

    Default Re: ActiveQT G++ Error

    Quote Originally Posted by CHeader View Post
    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".
    J-P Nurmi

Similar Threads

  1. QPSQL driver in windows
    By brevleq in forum Installation and Deployment
    Replies: 31
    Last Post: 14th December 2007, 12:57
  2. Error compiling psql plugin
    By vieraci in forum Installation and Deployment
    Replies: 4
    Last Post: 7th October 2007, 02:49
  3. qt 4.2.2 install on aix
    By try to remember in forum Installation and Deployment
    Replies: 2
    Last Post: 28th March 2007, 12:19
  4. Qt-x11-commercial-src-4.2.0-snapshot-20060824 error
    By DevObject in forum Installation and Deployment
    Replies: 4
    Last Post: 24th August 2006, 23:31
  5. use qpsql
    By raphaelf in forum Installation and Deployment
    Replies: 34
    Last Post: 22nd August 2006, 12:52

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.