Qt Forum

    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Unsolved

    Update: Forum Guidelines & Code of Conduct

    Linking with QtWebKit

    Installation and Deployment
    3
    4
    3872
    Loading More Posts
    • 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.
    • Z
      zodiac last edited by

      Hello. I've tried to link with qtwebkit, but it's failed.

      Firstly, error were:
      @Creating library webkit-test.lib and object webkit-test.exp
      main.cpp.obj : error LNK2001: unresolved external symbol "public: static struct
      QMetaObject const QWebPage::staticMetaObject" (?staticMetaObject@QWebPage@@2UQMetaObject@@B)
      main.cpp.obj : error LNK2019: unresolved external symbol "public: __thiscall QWebPage::QWebPage(class QObject *)" (??0QWebPage@@QAE@PAVQObject@@@Z) referenced in function "public: void __thiscall QWebPage::default constructor closure'(void)" (??_FQWebPage@@QAEXXZ) main.cpp.obj : error LNK2001: unresolved external symbol "public: static struct QMetaObject const QWebView::staticMetaObject" (?staticMetaObject@QWebView@@2UQMetaObject@@B) main.cpp.obj : error LNK2019: unresolved external symbol "public: __thiscall QWebView::QWebView(class QWidget *)" (??0QWebView@@QAE@PAVQWidget@@@Z) referenced in function "public: void __thiscall QWebView::default constructor closure'(void)" (??_FQWebView@@QAEXXZ)
      webkit-test.exe : fatal error LNK1120: 4 unresolved externals@

      but when I added "TARGET_LINK_LIBRARIES( webkit-test G:/git/qt5/qtwebkit/WebKitBuild/Release/lib/QtWebKit5.lib )" to my CMakeLists.txt, error number decreased and now it's:
      @ Creating library webkit-test.lib and object webkit-test.exp
      main.cpp.obj : error LNK2001: unresolved external symbol "public: static struct
      QMetaObject const QWebPage::staticMetaObject" (?staticMetaObject@QWebPage@@2UQMetaObject@@B)
      main.cpp.obj : error LNK2001: unresolved external symbol "public: static struct
      QMetaObject const QWebView::staticMetaObject" (?staticMetaObject@QWebView@@2UQMetaObject@@B)
      webkit-test.exe : fatal error LNK1120: 2 unresolved externals@

      G:\webkit-test\dumpbin.exe /EXPORTS QtWebKit5.lib
      outputs:
      @Microsoft (R) COFF/PE Dumper Version 10.00.40219.01
      Copyright (C) Microsoft Corporation. All rights reserved.

      Dump of file G:\git\qt5\qtwebkit\WebKitBuild\Release\lib\QtWebKit5.lib

      File Type: LIBRARY

       Exports
      

      ...
      ?staticMetaObject@QWebPage@@2UQMetaObject@@B (public: static struct QMetaObject const QWebPage::staticMetaObject)
      ...
      ?staticMetaObject@QWebView@@2UQMetaObject@@B (public: static struct QMetaObject const QWebView::staticMetaObject)
      ...@

      Why I have this error?

      Project: http://rghost.ru/39274557
      Qt5 from git, cmake 2.8.8, msvs 2010

      1 Reply Last reply Reply Quote 0
      • Z
        zodiac last edited by

        Doesn't anyone know?

        1 Reply Last reply Reply Quote 0
        • G
          GGodis last edited by

          Hello zodiac, I had the same problem.
          Addind "QT_DLL" flag to my project's processor definitions have fixed this error!
          (For VisualStudio go to "Configuration Properties" -> "C/C++" -> "Preprocessor")

          1 Reply Last reply Reply Quote 0
          • N
            nicole_yaoyao last edited by

            I also had the same problem , could you explain clearly?
            how to add and add waht

            1 Reply Last reply Reply Quote 0
            • First post
              Last post