PDA

View Full Version : Using K Objects in Qt project



dec0ding
16th January 2006, 20:55
Hi,

all projects I have been working so far has been created using pure Qt code. Now I see some interesting K classes and want to use them. I put them in my test application (using KUrl object) and at linking time I get this:

obj/form1.o(.text+0x42a): In function Form1::Form1[not-in-charge](QWidget*, char const*, bool, unsigned)':
: undefined reference to KURLRequester::KURLRequester[in-charge](QWidget*, char const*)'

I put LIBS += -L/opt/kde/lib in my pro file but no help

wysota
16th January 2006, 21:00
You have to link with proper kde libs (LIBS += -lkdeui -lkdecore and/or other). And use KApplication instead of QApplication. Generally this is called KDE programming ;)

mcosta
17th January 2006, 11:08
Hi,

all projects I have been working so far has been created using pure Qt code. Now I see some interesting K classes and want to use them. I put them in my test application (using KUrl object) and at linking time I get this:



If you need to use KDE Widget I suggest you to make a KDE Application.
In this way you can use complete KDE framework utilities.

Bye

dec0ding
17th January 2006, 13:04
If you need to use KDE Widget I suggest you to make a KDE Application.
In this way you can use complete KDE framework utilities.

Bye

Ok but I have written 1000 code so I need to use some KDE Widgets now, that is why I asked...

Wysota: I tryed -lkdeui and -lkdecore but both show this error:

usr/lib/gcc-lib/i486-slackware-linux/3.3.6/../../../../i486-slackware-linux/bin/ld: cannot find -lkdeui
collect2: ld returned 1 exit status
make: *** [learn] Error 1

Thanks

wysota
17th January 2006, 13:07
Wysota: I tryed -lkdeui and -lkdecore but both show this error:


You need to provide a path to look for those libs (using -Lsome_directory)

dec0ding
17th January 2006, 13:17
Ok solved...
I put the project in KDevelop and now working from there ;)

Thanks both

jacek
17th January 2006, 14:07
I put in my *.pro file this:

LIBS += -L/opt/kde/lib/

then, where do I put -lkdeui, -lkdecore?e
In the same place:

LIBS += -L/opt/kde/lib/ -lkdeui -lkdecore

high_flyer
17th January 2006, 18:30
You should take in consideration, that by using kde libs, you are loosing one of Qt best fetures - its portability.
So if you want to write applications that will run on kde explicitly, then ok, but if not, better create your own classes in Qt that do the same as the KDE calsses that you use do.

dec0ding
17th January 2006, 19:44
In the same place:

LIBS += -L/opt/kde/lib/ -lkdeui -lkdecore

Thanks ;)

theLSB: well u said good thing that I never thought of...maybe I will go on with pure Qt ...