May 15, 2012

chr_charles chr_charles
Lab Rat
2 posts

link error with static webkit 4.8.1

 

Hi all,

I’m stuck with a basic link error.

I’m using Visual 2008 and the Qt pluging on Windows 7 ×64 and Qt 4.8.1

I have a small class who inherits from QWebPage and I cannot link it with QWebkit.

my class :

  1. class MyQWebPage: public QWebPage {
  2.  Q_OBJECT ;
  3. private:
  4.  ResourceObject & resource;
  5. public:
  6.  MyQWebPage(ResourceObject & res);
  7.  virtual void javaScriptAlert(QWebFrame * frame, const QString & msg);
  8.  virtual bool javaScriptConfirm(QWebFrame * frame, const QString & msg);
  9.  virtual bool javaScriptPrompt(QWebFrame * frame, const QString & msg, const QString & defaultValue, QString * result);
  10.  virtual void javaScriptConsoleMessage(const QString & message, int lineNumber, const QString & sourceID);
  11. public slots:
  12.  bool shouldInterruptJavaScript();
  13. };

first error :
1>mywebclass.obj : error LNK2001: unresolved external symbol “public: static struct QMetaObject const QWebPage::staticMetaObject” (?staticMetaObject@QWebPage@@2UQMetaObject@@B)

And I have 8 of them like this one.

In the Qt project settings, QwebKit is included, on the project setting the lib file QtWebKitd4.lib is a dependencies.

In the file there are other class like

  1. class MyNetworkAccessManager: public QNetworkAccessManager {
  2.  Q_OBJECT
  3. private:
  4.  ...
  5. public:
  6.         ...
  7. signals:
  8.  ...
  9. };

but those one does not produce link error.

Can someone help me ?

Thanks.

8 replies

May 15, 2012

koahnig koahnig
Mad Scientist
2099 posts

welcome to devnet

Did you create static Qt libs?
AFAIK that is not possible with webkit.

May 15, 2012

chr_charles chr_charles
Lab Rat
2 posts

thanks for your response.

Nope, I’m using the web kit as provided by qt, using the lib file and header files and at last the dlls.

May 24, 2012

eikeR eikeR
Lab Rat
27 posts

did you create the .moc files with moc.exe?

May 27, 2012

Volker Volker
Robot Herder
5428 posts

It is not supported to use webkit in a static build of Qt. It was mentioned in some documentation, but I don’t remember where exactly.

May 31, 2012

Landy Landy
Ant Farmer
57 posts

If so, how can we use web feature, i mean something like QWebPage or QWebView, in static build of Qt?

Volker wrote:
It is not supported to use webkit in a static build of Qt. It was mentioned in some documentation, but I don’t remember where exactly.

May 31, 2012

Volker Volker
Robot Herder
5428 posts
Landy wrote:
If so, how can we use web feature, i mean something like QWebPage or QWebView, in static build of Qt?

I have no idea, sorry.

June 1, 2012

Landy Landy
Ant Farmer
57 posts

Ohh, it’s really a bad news to me.
I have to i have to use web feature in a static build of Qt.
I can’t believe that there was no web control before webkit was intergrated into Qt.
Anyway, thanks for your reply, Volker.

Volker wrote:
Landy wrote:
If so, how can we use web feature, i mean something like QWebPage or QWebView, in static build of Qt?

I have no idea, sorry.

June 4, 2012

Volker Volker
Robot Herder
5428 posts

While not a full featured web browser, QTextBrowser might support a suitable subset of HTML for your use case.

 
  ‹‹ Printing a QWebView doesn’t seem to honour page breaks?      Access to WebElements through WebKit2 Touch API ››

You must log in to post a reply. Not a member yet? Register here!