View Full Version : KHTMLView linker error:

1st March 2006, 19:26
I'm trying to use a KHTML View to show some html stuff in my app, but when try to compile it I get the following linker error...

/home/shadow/project/kreator/src/genericcharmwidget.cpp:60: undefined reference to `KHTMLPart::KHTMLPart(QWidget*, char const*, QObject*, char const*, KHTMLPart::GUIProfile)'
/home/shadow/project/kreator/src/genericcharmwidget.cpp:61: undefined reference to `KHTMLView::KHTMLView(KHTMLPart*, QWidget*, char const*)'

I've included the proper headers for both KTMLView and KHTMLPart and get no compiler errors.

In my setupUI() function (called in constructor) I have:

charmViewPart=new KHTMLPart(this);
charmView=new KHTMLView(charmViewPart,this);

1st March 2006, 19:35
Do you link your project with KDE libraries?

1st March 2006, 19:57
I have no trouble with any of the other KDE components I'm using (ie KApplication, loads of Kde widgets etc.)

I'm using KDevelop 3.3.1

1st March 2006, 20:26
Try adding "LIBS += -lkhtml" to your .pro file.

1st March 2006, 20:39
That did it :)

Didn't realize that khtml was it's own library.