PDA

View Full Version : KHTMLView linker error:



ReilenBlaeyze
1st March 2006, 20: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);

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

ReilenBlaeyze
1st March 2006, 20: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

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

ReilenBlaeyze
1st March 2006, 21:39
That did it :)

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