[Solved] LNK2001 while building Qt5 with VS2012 Pro



  • I followed the instructions "here":https://qt-project.org/wiki/Building_Qt_5_from_Git for checking out the Qt5 source from Git. I used the --no-webit when running perl init-repository. "Here":http://pastebin.com/7MjwE5vn are the configure options I used.

    I'm running Windows 8 64-bit and compiling 32-bit binaries via the x86 Visual Studio Command prompt. The build fails with the following unresolved symbol linker error.

    @moc_qopenglengineshadermanager_p.cpp
    echo 2 /* CREATEPROCESS_MANIFEST_RESOURCE_ID / 24 / RT_MANIFEST */ "..\..\lib\Qt5Guid.dll.embed.manifest">....\lib\Qt5Guid.dll_manifest.rc
    if not exist ....\lib\Qt5Guid.dll del ....\lib\Qt5Guid.dll.embed.manifest>NUL 2>&1
    if exist ....\lib\Qt5Guid.dll.embed.manifest copy /Y ....\lib\Qt5Guid.dll.embed.manifest ....\lib\Qt5Guid.dll_manifest.bak
    link /NOLOGO /DYNAMICBASE /NXCOMPAT /DEBUG /DLL /VERSION:5.01 /MANIFEST /MANIFESTFILE:....\lib\Qt5Guid.dll.embed.manifest /OUT:....\lib\Qt5Guid.dll @C:\Users\Ashish\AppData\Local\Temp\nm923F.tmp
    Creating library ....\lib\Qt5Guid.lib and object ....\lib\Qt5Guid.exp
    qguiapplication.obj : error LNK2001: unresolved external symbol "public: virtual struct QMetaObject const * __thiscall QAccessible::metaObject(void)const " (?metaObject@QAccessible@@UBEPBUQMetaObject@@XZ)
    qguiapplication.obj : error LNK2001: unresolved external symbol "public: virtual void * __thiscall QAccessible::qt_metacast(char const *)" (?qt_metacast@QAccessible@@UAEPAXPBD@Z)
    qguiapplication.obj : error LNK2001: unresolved external symbol "public: virtual int __thiscall QAccessible::qt_metacall(enum QMetaObject::Call,int,void * *)" (?qt_metacall@QAccessible@@UAEHW4Call@QMetaObject@@HPAPAX@Z)
    qguiapplication.obj : error LNK2019: unresolved external symbol "public: static void __cdecl QAccessible::updateAccessibility(class QAccessibleEvent *)" (?updateAccessibility@QAccessible@@SAXPAVQAccessibleEvent@@@Z) referenced in function "public: static void __cdecl QAccessible::updateAccessibility(class QObject *,int,enum QAccessible::Event)" (?updateAccessibility@QAccessible@@SAXPAVQObject@@HW4Event@1@@Z)
    qguiapplication.obj : error LNK2001: unresolved external symbol "public: virtual class QWindow * __thiscall QAccessibleInterface::window(void)const " (?window@QAccessibleInterface@@UBEPAVQWindow@@XZ)
    qguiapplication.obj : error LNK2001: unresolved external symbol "public: virtual class QVector<struct QPair<class QAccessibleInterface *,class QFlags<enum QAccessible::RelationFlag> > > __thiscall QAccessibleInterface::relations(class QFlags<enum QAccessible::RelationFlag>)const " (?relations@QAccessibleInterface@@UBE?AV?$QVector@U?$QPair@PAVQAccessibleInterface@@V?$QFlags@W4RelationFlag@QAccessible@@@@@@@@V?$QFlags@W4RelationFlag@QAccessible@@@@@Z)
    qguiapplication.obj : error LNK2001: unresolved external symbol "public: virtual class QAccessibleInterface * __thiscall QAccessibleInterface::focusChild(void)const " (?focusChild@QAccessibleInterface@@UBEPAV1@XZ)
    qguiapplication.obj : error LNK2001: unresolved external symbol "public: virtual class QColor __thiscall QAccessibleInterface::foregroundColor(void)const " (?foregroundColor@QAccessibleInterface@@UBE?AVQColor@@XZ)
    qguiapplication.obj : error LNK2001: unresolved external symbol "public: virtual class QColor __thiscall QAccessibleInterface::backgroundColor(void)const " (?backgroundColor@QAccessibleInterface@@UBE?AVQColor@@XZ)
    qguiapplication.obj : error LNK2001: unresolved external symbol "public: virtual void __thiscall QAccessibleInterface::virtual_hook(int,void *)" (?virtual_hook@QAccessibleInterface@@UAEXHPAX@Z)
    qguiapplication.obj : error LNK2001: unresolved external symbol "public: virtual class QAccessibleInterface * __thiscall QAccessibleEvent::accessibleInterface(void)const " (?accessibleInterface@QAccessibleEvent@@UBEPAVQAccessibleInterface@@XZ)
    qguiapplication.obj : error LNK2001: unresolved external symbol "public: static struct QMetaObject const QAccessible::staticMetaObject" (?staticMetaObject@QAccessible@@2UQMetaObject@@B)
    ....\lib\Qt5Guid.dll : fatal error LNK1120: 12 unresolved externals
    NMAKE : fatal error U1077: '"C:\Program Files (x86)\Microsoft Visual Studio 11.0\VC\BIN\link.EXE"' : return code '0x460'
    Stop.
    NMAKE : fatal error U1077: '"C:\Program Files (x86)\Microsoft Visual Studio 11.0\VC\BIN\nmake.exe"' : return code '0x2'
    Stop.
    NMAKE : fatal error U1077: 'cd' : return code '0x2'
    Stop.
    NMAKE : fatal error U1077: 'cd' : return code '0x2'
    Stop.
    NMAKE : fatal error U1077: 'cd' : return code '0x2'
    Stop.
    @

    What did I do wrong?



  • Seems removing the -no-accessibility option from the configure arguments fixes this error.


Log in to reply
 

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.