Results 1 to 3 of 3

Thread: Qt5 and MSVC2012 - unresolved external error

  1. #1
    Join Date
    Aug 2012
    Posts
    17
    Thanks
    2
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Qt5 and MSVC2012 - unresolved external error

    I'm trying to compile the most basic Qt program with static linking, using Visual Studio 2012 with installed add-in to Qt. I have build Qt with:

    configure -platform win32-msvc2012 -no-angle -opengl desktop -no-icu -static -nomake demos -nomake examples

    Everything went perfect. I have created project Qt5:

    Qt Code:
    1. #include "test.h"
    2. #include <QtWidgets/QApplication>
    3.  
    4. int main(int argc, char *argv[])
    5. {
    6. QApplication a(argc, argv);
    7. test w;
    8. w.show();
    9. return a.exec();
    10. }
    To copy to clipboard, switch view to plain text mode 

    (test w is just a window) and tried to compile it but i'm getting error:

    1> Creating library D:\Visual Studio 11\Projects\test\Win32\Release\test.lib and object D:\Visual Studio 11\Projects\test\Win32\Release\test.exp
    1>Qt5Core.lib(qeventdispatcher_win.obj) : error LNK2019: unresolved external symbol _WSAAsyncSelect@16 referenced in function "private: void __thiscall QEventDispatcherWin32::createInternalHwnd(void)" (?createInternalHwnd@QEventDispatcherWin32@@AAEXXZ )
    1>D:\Visual Studio 11\Projects\test\Win32\Release\\test.exe : fatal error LNK1120: 1 unresolved externals

    All libs are included (this is done by add-in) and in project settings -> C/C++ -> Code generation i set Runtime library to MT (static linking). Any ideas?

    EDIT

    Btw. in Qt Creator everything works fine.
    Last edited by Blood9999; 13th February 2013 at 20:12.

  2. #2
    Join Date
    Jan 2013
    Location
    Temecula, CA
    Posts
    19
    Thanks
    11
    Qt products
    Qt5
    Platforms
    Windows

    Default Re: Qt5 and MSVC2012 - unresolved external error

    Have you tried adding
    Qt Code:
    1. CONFIG += static
    To copy to clipboard, switch view to plain text mode 
    to your .pro file?

  3. #3
    Join Date
    Sep 2011
    Posts
    1,241
    Thanks
    3
    Thanked 127 Times in 126 Posts
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: Qt5 and MSVC2012 - unresolved external error

    have you linked with WS2_32.DLL/lib ?
    If you have a problem, CUT and PASTE your code. Do not retype or simplify it. Give a COMPLETE and COMPILABLE example of your problem. Otherwise we are all guessing the problem from a fabrication where relevant details are often missing.

Similar Threads

  1. Replies: 2
    Last Post: 11th February 2013, 22:28
  2. Replies: 2
    Last Post: 8th February 2013, 19:52
  3. error LNK2019: unresolved external symbol
    By 8080205 in forum Newbie
    Replies: 3
    Last Post: 3rd October 2012, 15:53
  4. Unresolved external error in Qt5 when using QPrinter
    By alizadeh91 in forum Qt Programming
    Replies: 2
    Last Post: 19th July 2012, 08:58
  5. error LNK2001: unresolved external symbol _IID_ID3DXEffec tStateManager
    By Tusharsankhala in forum Installation and Deployment
    Replies: 0
    Last Post: 16th May 2012, 18:16

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
  •  
Qt is a trademark of The Qt Company.