PDA

View Full Version : KDE on QT4



SimbadSubZero
1st December 2009, 08:22
hi all,
I have installed QT 4 on Ubuntu 9.04 and I would like to use KDE resources from QT designer tool but I received some error compilation when I am tried to use it.
Please advice what I need to install(packages) and how configure it. A web link will be good
Many thanks
Simbad

lyuts
1st December 2009, 09:19
Very informative.
What errors did you get? When did you get them?

SimbadSubZero
1st December 2009, 09:31
Thanks for your reply, I recieved the following error
.../ui_file.h:22: error: kled.h: No such file or directory
I didn't write this first since I think I need to install KDE lib such as Kled and others

lyuts
1st December 2009, 09:34
You need to install kdelibs4-dev and make sure that INCLUDEPATH points to the right location of kled.h

SimbadSubZero
1st December 2009, 09:43
I have installed it OK but when I tried to search kled.h file, it does not exist....

SimbadSubZero
1st December 2009, 10:07
I found it on /usr/include/kde

Thanks

SimbadSubZero
1st December 2009, 10:29
Now I got problem with reference
../ui_filename.h:56: undefined reference to `KLed::KLed(QWidget*, char const*)'
:confused:

lyuts
1st December 2009, 11:12
If you are using .pro file then you need to specify DEPENDPATH and LIBS, if not, make sure you specify correct library path through -L and correct libraryname through -l flags (el)

SimbadSubZero
1st December 2009, 11:29
yes, I am using *.pro file but I didn't find the library that contains Kled. please help..

lyuts
1st December 2009, 11:33
What is the list of files installed by that package (that you have installed) recently?

SimbadSubZero
1st December 2009, 11:35
I fixed OK, but now I had new error
error: collect2: ld returned 1 exit status

lyuts
1st December 2009, 11:39
The linking didn't succeed. Can you show this pro file?

SimbadSubZero
1st December 2009, 11:49
# ################################################## ###################
# Automatically generated by qmake (2.01a) Tue Nov 10 13:22:55 2009
# ################################################## ###################
TEMPLATE = app
TARGET =
LIBS += /usr/lib/kde4
INCLUDEPATH += $(PROJECT)/SimpleUseStatic/ /home/simbad/workspace/SimpleUseLib/ /usr/include/kde
# Input
HEADERS += keypadfirsttest.h \
TestKeypad.h \
/home/simbad/workspace/SimpleUseLib/CSimpleUser.h \
/home/simbad/workspace/SimpleUseStatic/CSimpleStaticUse.h
FORMS += keypadfirsttest.ui
SOURCES += keypadfirsttest.cpp \
main.cpp \
TestKeypad.cpp \
/home/simbad/workspace/SimpleUseLib/CSimpleUser.cpp \
/home/simbad/workspace/SimpleUseStatic/CSimpleStaticUse.cpp
OTHER_FILES +=

lyuts
1st December 2009, 11:58
That is not correct.
Your LIBS is not properly defined.
You LIBS should look like this:


LIBS += -L/usr/lib/kde4 -l<kde_lib>


where <kde_lib> is the name of the library (without word 'lib') which contains the function that you are using.

E.g. You are using the function from the libextracthere.so, then you have to specify "-lextracthere".

Sorry, I can't be more specific, because I'm not familiar with your code.

SimbadSubZero
1st December 2009, 12:10
OK, thanks I will try to fix it.
Maybe you know how could I know which KDE c or cpp file are related to specific header file. I mean how could I recolonize which KLed.h belong to specif library in the link process.

lyuts
1st December 2009, 12:14
You are using some KDE function which is declared in kled.h, right? So, you know its name. If I didn't know the name of the lib, I would use nm or objdump to explore libs in /usr/lib/kde4. (This approach is not the fastest, but the easiest, at least for me).