Results 1 to 2 of 2

Thread: MSVC 2010 with wizard plugin: Project fails to link with wizard generated code

  1. #1
    Join Date
    Jul 2010
    Posts
    5
    Qt products
    Qt4
    Platforms
    Windows

    Default MSVC 2010 with wizard plugin: Project fails to link with wizard generated code

    Hi, I have Visual studio 2010, and I have compiled the QT 4.7.1 library and I have installed the Nokia QT plugin for MSVC

    I can now use the wizard to generate a project, ex: QT Console application with QTCore, and QTGUI

    The default project looks like this, and it compiles and runs even if it fails to be useful


    #include "qapplication.h"

    int main(int argc, char *argv[])
    {
    QCoreApplication a(argc, argv);

    QString appName("Colton Configurator V1.0");
    a.setApplicationName(appName);

    return a.exec();
    }


    Now, all I do is add the following lines


    #include "qapplication.h"
    #include "qwidget.h"

    int main(int argc, char *argv[])
    {
    QCoreApplication a(argc, argv);

    QString appName("Colton Configurator V1.0");
    a.setApplicationName(appName);


    QWidget widget;
    //widget.show();


    return a.exec();
    }


    and then I get the linker insanity shown below. I think this is a problem with the plugin not calling QMake to update stuff once compiled, but how do you get around this problem? I get a similar problem if I use the command "Clean All" prior to rebuilding.

    Any help is appreciated, thanks.

    meek




    1> All outputs are up-to-date.
    1>QtGuid.lib(qaccessible_win.obj) : error LNK2019: unresolved external symbol __imp__PlaySoundW@12 referenced in function "public: static void __cdecl QAccessible::updateAccessibility(class QObject *,int,enum QAccessible::Event)" (?updateAccessibility@QAccessible@@SAXPAVQObject@@ HW4Event@1@@Z)
    1>QtGuid.lib(qwininputcontext_win.obj) : error LNK2019: unresolved external symbol _ImmSetCandidateWindow@8 referenced in function "public: virtual void __thiscall QWinInputContext::update(void)" (?update@QWinInputContext@@UAEXXZ)
    1>QtGuid.lib(qwininputcontext_win.obj) : error LNK2019: unresolved external symbol _ImmSetCompositionWindow@8 referenced in function "public: virtual void __thiscall QWinInputContext::update(void)" (?update@QWinInputContext@@UAEXXZ)
    1>QtGuid.lib(qwininputcontext_win.obj) : error LNK2019: unresolved external symbol _ImmSetCompositionFontW@8 referenced in function "public: virtual void __thiscall QWinInputContext::update(void)" (?update@QWinInputContext@@UAEXXZ)
    1>QtGuid.lib(qwininputcontext_win.obj) : error LNK2019: unresolved external symbol _ImmGetContext@4 referenced in function "struct HIMC__ * __cdecl getContext(struct HWND__ *)" (?getContext@@YAPAUHIMC__@@PAUHWND__@@@Z)
    1>QtGuid.lib(qwininputcontext_win.obj) : error LNK2019: unresolved external symbol _ImmReleaseContext@8 referenced in function "void __cdecl releaseContext(struct HWND__ *,struct HIMC__ *)" (?releaseContext@@YAXPAUHWND__@@PAUHIMC__@@@Z)
    1>QtGuid.lib(qwininputcontext_win.obj) : error LNK2019: unresolved external symbol _ImmNotifyIME@16 referenced in function "void __cdecl notifyIME(struct HIMC__ *,unsigned long,unsigned long,unsigned long)" (?notifyIME@@YAXPAUHIMC__@@KKK@Z)
    1>QtGuid.lib(qwininputcontext_win.obj) : error LNK2019: unresolved external symbol _ImmGetCompositionStringW@16 referenced in function "long __cdecl getCompositionString(struct HIMC__ *,unsigned long,void *,unsigned long)" (?getCompositionString@@YAJPAUHIMC__@@KPAXK@Z)
    1>QtGuid.lib(qwininputcontext_win.obj) : error LNK2019: unresolved external symbol _ImmAssociateContext@8 referenced in function "void __cdecl enableIme(class QWidget *,bool)" (?enableIme@@YAXPAVQWidget@@_N@Z)
    1>QtGuid.lib(qwininputcontext_win.obj) : error LNK2019: unresolved external symbol _ImmGetDefaultIMEWnd@4 referenced in function "struct HWND__ * __cdecl getDefaultIMEWnd(struct HWND__ *)" (?getDefaultIMEWnd@@YAPAUHWND__@@PAU1@@Z)
    1>C:\Users\Admin\Documents\Visual Studio 2010\Projects\Mike_qt_config\\Mike_qt_config.exe : fatal error LNK1120: 10 unresolved externals
    1>
    1>Build FAILED.
    1>
    1>Time Elapsed 00:00:01.10

  2. #2
    Join Date
    May 2010
    Location
    Romania
    Posts
    1,021
    Thanks
    62
    Thanked 260 Times in 246 Posts
    Qt products
    Qt5
    Platforms
    MacOS X Unix/X11 Windows Android

    Default Re: MSVC 2010 with wizard plugin: Project fails to link with wizard generated code

    Try it with QApplication instead of QCoreApplication

    //and also the includes should be between <> and without .h
    Hello world:
    Qt Code:
    1. #include <QApplication>
    2. #include <QWidget>
    3.  
    4. int main(int argc, char *argv[])
    5. {
    6. QApplication a(argc, argv);
    7.  
    8. QString appName("Colton Configurator V1.0");
    9. a.setApplicationName(appName);
    10.  
    11.  
    12. QWidget widget;
    13. widget.show();
    14. return a.exec();
    15. }
    To copy to clipboard, switch view to plain text mode 

Similar Threads

  1. MSVC Project generated using qmake - turn off flat structure
    By Piskvorkar in forum Qt Programming
    Replies: 3
    Last Post: 4th February 2013, 23:25
  2. Qt Creator Crossplatform project wizard
    By lunarcloud in forum Qt Tools
    Replies: 0
    Last Post: 11th April 2011, 07:43
  3. To Wizard or Not ?
    By fassage in forum Qt Programming
    Replies: 1
    Last Post: 6th November 2009, 10:42
  4. Using images in wizard
    By xfurrier in forum Newbie
    Replies: 1
    Last Post: 10th April 2009, 13:47
  5. How to add a Wizard ?
    By npc in forum Qt Tools
    Replies: 4
    Last Post: 24th July 2007, 14:28

Tags for this Thread

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.