Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Installation and Deployment
  4. Linking with QtWebKit
Qt 6.11 is out! See what's new in the release blog

Linking with QtWebKit

Scheduled Pinned Locked Moved Installation and Deployment
4 Posts 3 Posters 4.2k 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.
  • Z Offline
    Z Offline
    zodiac
    wrote on last edited by
    #1

    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
    0
    • Z Offline
      Z Offline
      zodiac
      wrote on last edited by
      #2

      Doesn't anyone know?

      1 Reply Last reply
      0
      • G Offline
        G Offline
        GGodis
        wrote on last edited by
        #3

        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
        0
        • N Offline
          N Offline
          nicole_yaoyao
          wrote on last edited by
          #4

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

          1 Reply Last reply
          0

          • Login

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