You are not logged in.

Dear visitor, welcome to QtForum.org. If this is your first visit here, please read the Help. It explains in detail how this page works. To use all features of this page, you should consider registering. Please use the registration form, to register here or read more information about the registration process. If you are already registered, please login here.

1

Saturday, September 24th 2005, 6:32am

Linking error with KDE Widgets

Hello,


My application gives me linker errors when i try to include the KDE widgets, i have spent some time searching, but so far to no avail. I installed QT from mandrake 10.0, here is the output from kde-config --version

Source code

1
2
3
Qt: 3.3.3
KDE: 3.2 BRANCH >= 20040204
kde-config: 1.0


Below shows the errors that i am getting when linking.

Source code

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
/usr/lib/qt3//bin/uic frmmain.ui -o .ui/frmmain.h
g++ -c -pipe -Wall -W -O2 -fomit-frame-pointer -pipe -march=i586 -mtune=pentiumpro -D_REENTRANT  -DQT_NO_DEBUG -DQT_THREAD_SUPPORT -DQT_SHARED -I/usr/lib/qt3/mkspecs/default -I. -I/usr/lib/qt3//include -I.ui/ -I. -I.moc/ -o .obj/main.o main.cpp
/usr/lib/qt3//bin/uic frmmain.ui -i frmmain.h -o .ui/frmmain.cpp
g++ -c -pipe -Wall -W -O2 -fomit-frame-pointer -pipe -march=i586 -mtune=pentiumpro -D_REENTRANT  -DQT_NO_DEBUG -DQT_THREAD_SUPPORT -DQT_SHARED -I/usr/lib/qt3/mkspecs/default -I. -I/usr/lib/qt3//include -I.ui/ -I. -I.moc/ -o .obj/frmmain.o .ui/frmmain.cpp
/usr/lib/qt3//bin/moc .ui/frmmain.h -o .moc/moc_frmmain.cpp
g++ -c -pipe -Wall -W -O2 -fomit-frame-pointer -pipe -march=i586 -mtune=pentiumpro -D_REENTRANT  -DQT_NO_DEBUG -DQT_THREAD_SUPPORT -DQT_SHARED -I/usr/lib/qt3/mkspecs/default -I. -I/usr/lib/qt3//include -I.ui/ -I. -I.moc/ -o .obj/moc_frmmain.o .moc/moc_frmmain.cpp
g++  -o Set .obj/main.o .obj/frmmain.o .obj/moc_frmmain.o   -L/usr/lib/qt3//lib -L/usr/X11R6/lib -lkdeui -L/usr/lib/kde3/plugins/designer -lqt-mt -lXext -lX11 -lm -lpthread
/usr/bin/ld: warning: libstdc++.so.6, needed by /usr/lib/qt3//lib/libqt-mt.so, may conflict with libstdc++.so.5
.obj/frmmain.o(.text+0x2ca): In function `FrmMain::FrmMain[not-in-charge](QWidget*, char const*, unsigned)':
: undefined reference to `KIconButton::KIconButton[in-charge](QWidget*, char const*)'
.obj/frmmain.o(.text+0x3e7): In function `FrmMain::FrmMain[not-in-charge](QWidget*, char const*, unsigned)':
: undefined reference to `KIconButton::KIconButton[in-charge](QWidget*, char const*)'
.obj/frmmain.o(.text+0x75a): In function `FrmMain::FrmMain[not-in-charge](QWidget*, char const*, unsigned)':
: undefined reference to `KIconButton::KIconButton[in-charge](QWidget*, char const*)'
.obj/frmmain.o(.text+0x982): In function `FrmMain::FrmMain[not-in-charge](QWidget*, char const*, unsigned)':
: undefined reference to `KIconButton::KIconButton[in-charge](QWidget*, char const*)'
.obj/frmmain.o(.text+0xa67): In function `FrmMain::FrmMain[not-in-charge](QWidget*, char const*, unsigned)':
: undefined reference to `KIconButton::KIconButton[in-charge](QWidget*, char const*)'
.obj/frmmain.o(.text+0xb95): more undefined references to `KIconButton::KIconButton[in-charge](QWidget*, char const*)' follow
collect2: ld returned 1 exit status
make: *** [Set] Error 1


Below is an extract from my makefile

Source code

1
2
3
4
INCPATH  = -I/usr/lib/qt3/mkspecs/default -I. -I$(QTDIR)/include -I.ui/ -I. -I.moc/
LINK     = g++
LFLAGS   =
LIBS     = $(SUBLIBS) -L$(QTDIR)/lib -L/usr/X11R6/lib -lkdeui -L/usr/lib/kde3/plugins/designer -lqt-mt -lXext -lX11 -lm -lpthread



Any help you could give me would be greatly appreciated.

Thanks

2

Saturday, September 24th 2005, 2:22pm

RE: Linking error with KDE Widgets

Try setting your environment QTDIR without the trailing "/" and do a make clean && make. This might cure this. Why do you have several versions of libstdc++ on your system? There seems to be a conflict too
There's no place like ::1

3

Sunday, September 25th 2005, 4:45am

RE: Linking error with KDE Widgets

Solved...

the KDE KIconButton is part of the kio library, not the kdeui library....

needed to add -lkio to the link list

Thanks though!