Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. [SOLVED] Linker Error While linking application(form of DLL) with Qt libs
Forum Updated to NodeBB v4.3 + New Features

[SOLVED] Linker Error While linking application(form of DLL) with Qt libs

Scheduled Pinned Locked Moved General and Desktop
2 Posts 1 Posters 5.0k Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • T Offline
    T Offline
    Techtotie
    wrote on 18 Mar 2013, 11:49 last edited by
    #1

    Hi All,

           I am new to Qt(and to this group) and I am currently trying to link my software component libs(propreitary) with Qt Libs to form a DLL which will further be used by my application.
    

    In doing so I am facing linker issues. I did check if the symbols are present in the libs and Yes they are present in Libs, but still its unable to link.
    I am currently using Qt 4.8.4 on Windows using Visual Studio command prompt.
    The linker command on make is as follows.

    COMMAND:

    " link c:/my_sw_component/my_sw_components.obj c:/my_sw_component/my_sw_component.lib e:/platform/platform.lib c:/my_sw_component/platform.res
    e:/workspace/qtwebkit/qt-4.8.4/lib/QtCored4.lib
    e:/workspace/qtwebkit/qt-4.8.4/lib/QtGuid4.lib
    e:/workspace/qtwebkit/qt-4.8.4/lib/QtNetworkd4.lib
    e:/workspace/qtwebkit/qt-4.8.4/lib/QtWebkitd4.lib
    kernel32.lib gdi32.lib user32.lib WinInet.lib
    /nologo /DLL /subsystem:windows
    /libpath:e:/workspace/lib/
    /libpath:"C:/Program Files/Microsoft SDKs/Windows/v6.0A/Lib"
    /fixed:no /incremental:no /PDB:NONE /SAFESEH:NO /nodefaultlib /debug /map:c:/my_sw_component/my_sw_component.map /out:c:/my_sw_component/my_sw_component.dll
    "

    LINKER ERRORS:

    Creating library c:/my_sw_component/my_sw_component.lib and object c:/my_sw_component/my_sw_component.exp
    webkitbrowser.lib(qresourcemanager.obj) : error LNK2001: unresolved external symbol "private: static struct QByteArray::Data QByteArray::shared_null" (?shared_null@QByteArray@@0UData@1@A)
    webkitbrowser.lib(qnetworkreplyfileimpl.obj) : error LNK2001: unresolved external symbol "private: static struct QByteArray::Data QByteArray::shared_null" (?shared_null@QByteArray@@0UData@1@A)
    webkitbrowser.lib(qnetworkcookiejar.obj) : error LNK2001: unresolved external symbol "private: static struct QByteArray::Data QByteArray::shared_null" (?shared_null@QByteArray@@0UData@1@A)
    webkitbrowser.lib(keyboard.obj) : error LNK2001: unresolved external symbol "private: static struct QByteArray::Data QByteArray::shared_null" (?shared_null@QByteArray@@0UData@1@A)
    webkitbrowser.lib(webpage.obj) : error LNK2001: unresolved external symbol "private: static struct QByteArray::Data QByteArray::shared_null" (?shared_null@QByteArray@@0UData@1@A)
    webkitbrowser.lib(pushbutton.obj) : error LNK2001: unresolved external symbol "private: static struct QByteArray::Data QByteArray::shared_null" (?shared_null@QByteArray@@0UData@1@A)
    webkitbrowser.lib(qresourcemanager.obj) : error LNK2001: unresolved external symbol "private: static struct QString::Data QString::shared_null" (?shared_null@QString@@0UData@1@A)
    webkitbrowser.lib(qnetworkreplyfileimpl.obj) : error LNK2001: unresolved external symbol "private: static struct QString::Data QString::shared_null" (?shared_null@QString@@0UData@1@A)
    webkitbrowser.lib(qnetworkcookiejar.obj) : error LNK2001: unresolved external symbol "private: static struct QString::Data QString::shared_null" (?shared_null@QString@@0UData@1@A)
    ?shared_null@QString@@0UData@1@A)
    webkitbrowser.lib(qresourcemanager.obj) : error LNK2001: unresolved external symbol "public: char __thiscall QChar::toAscii(void)const " (?toAscii@QChar@@QBEDXZ)
    webkitbrowser.lib(qnetworkreplyfileimpl.obj) : error LNK2001: unresolved external symbol "public: char __thiscall QChar::toAscii(void)const " (?toAscii@QChar@@QBEDXZ)
    webkitbrowser.lib(qnetworkcookiejar.obj) : error LNK2001: unresolved external symbol "public: char __thiscall QChar::toAscii(void)const " (?toAscii@QChar@@QBEDXZ)
    webkitbrowser.lib(keyboard.obj) : error LNK2001: unresolved external symbol "public: char __thiscall QChar::toAscii(void)const " (?toAscii@QChar@@QBEDXZ)
    webkitbrowser.lib(webpage.obj) : error LNK2001: unresolved external symbol "public: char __thiscall QChar::toAscii(void)const " (?toAscii@QChar@@QBEDXZ)

    I did not find any suitable answer in net.

    Please provide me any inputs on how to resolve this error.

    Thanks in advance for help.

    Regards,
    Techtotie

    1 Reply Last reply
    0
    • T Offline
      T Offline
      Techtotie
      wrote on 20 Mar 2013, 12:19 last edited by
      #2

      Finally found the solution to this problem.

      It was because I compiled my application using wrong compiler defines
      QT_NODLL and QT_MAKEDLL.

      Instead it had to be compiled with QT_DLL and QT_SHARED.(for proper dllexport and dllimport configurations refer qglobal.h to decide which compiler defines to use).

      1 Reply Last reply
      0

      1/2

      18 Mar 2013, 11:49

      • Login

      • Login or register to search.
      1 out of 2
      • First post
        1/2
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • Users
      • Groups
      • Search
      • Get Qt Extensions
      • Unsolved