Results 1 to 6 of 6

Thread: problem when using QSystemTrayIcon

  1. #1
    Join Date
    Jan 2007
    Posts
    7
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default problem when using QSystemTrayIcon

    Dear all

    I'm trying to add a system tray icon to my application.
    The target system is Windows XP (sp2) and the QT version is 4.2.2

    I have added a QSystemTrayIcon to my main class, a menù and some actions, following this tutorial. The code compiles, the problem is during linking time. There are some symbols my Visual Studio (7.1) cannot find. The errors are are:

    error LNK2001: unresolved external symbol "protected: virtual bool __thiscall QSystemTrayIcon::event(class QEvent *)" (?event@QSystemTrayIcon@@MAE_NPAVQEvent@@@Z)
    error LNK2001: unresolved external symbol "public: virtual int __thiscall QSystemTrayIcon::qt_metacall(enum QMetaObject::Call,int,void * *)" (?qt_metacall@QSystemTrayIcon@@UAEHW4Call@QMetaObj ect@@HPAPAX@Z)
    error LNK2001: unresolved external symbol "public: virtual void * __thiscall QSystemTrayIcon::qt_metacast(char const *)" (?qt_metacast@QSystemTrayIcon@@UAEPAXPBD@Z)
    error LNK2001: unresolved external symbol "public: virtual struct QMetaObject const * __thiscall QSystemTrayIcon::metaObject(void)const " (?metaObject@QSystemTrayIcon@@UBEPBUQMetaObject@@X Z)
    error LNK2019: unresolved external symbol "__declspec(dllimport) public: void __thiscall QSystemTrayIcon::setContextMenu(class QMenu *)" (__imp_?setContextMenu@QSystemTrayIcon@@QAEXPAVQMe nu@@@Z)
    error LNK2019: unresolved external symbol "__declspec(dllimport) public: __thiscall QSystemTrayIcon::QSystemTrayIcon(class QObject *)" (__imp_??0QSystemTrayIcon@@QAE@PAVQObject@@@Z)
    error LNK2019: unresolved external symbol "__declspec(dllimport) public: virtual __thiscall QSystemTrayIcon::~QSystemTrayIcon(void)" (__imp_??1QSystemTrayIcon@@UAE@XZ) referenced in function "public: virtual void * __thiscall QSystemTrayIcon::`scalar deleting destructor'(unsigned int)" (??_GQSystemTrayIcon@@UAEPAXI@Z)



    Could someone help me to understand how can I solve this issue?

    Thanks in advance

  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: problem when using QSystemTrayIcon

    Are you 100% sure Visual Studio is not linking against older version of Qt? Are you using commercial or opensource version of Qt?
    J-P Nurmi

  3. #3
    Join Date
    Jan 2007
    Posts
    7
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: problem when using QSystemTrayIcon

    I'm using the commercial version... I thought maybe I'm linking an old qt version, as i passed several version on my machine... how can i find which version of qt visul studio is link?

    Many thanks

  4. #4
    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: problem when using QSystemTrayIcon

    In the Tools menu, choose Options/Qt/Builds.
    You can select there between the available versions.

    But you also have to make sure the environment variables are set correctly. Most important are QTDIR and PATH.
    The latter should be PATH=%QTDIR%\bin;%PATH%.

    Regards

  5. #5
    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: problem when using QSystemTrayIcon

    There is also a shortcut called "Change Qt version" in the context menu of the solution (in Solution Explorer).
    J-P Nurmi

  6. #6
    Join Date
    Jan 2007
    Posts
    7
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: problem when using QSystemTrayIcon

    great!!!

    now my program links and run, many many thanks

Similar Threads

  1. Graphics view display problem.
    By kiranraj in forum Qt Programming
    Replies: 3
    Last Post: 20th July 2007, 07:08
  2. [QMYSQL] connection problem
    By chaos_theory in forum Installation and Deployment
    Replies: 5
    Last Post: 2nd July 2007, 09:52
  3. Can't create an object : initialisation problem ?
    By Nyphel in forum Qt Programming
    Replies: 5
    Last Post: 12th March 2007, 09:07
  4. fftw problem
    By lordy in forum General Programming
    Replies: 1
    Last Post: 16th March 2006, 21:36
  5. Replies: 16
    Last Post: 7th March 2006, 15:57

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.