LinuxQuestions.org
Visit Jeremy's Blog.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 01-11-2010, 10:30 AM   #1
thandermax
Member
 
Registered: Jun 2005
Distribution: OpenSUSE 10.3 , 11.2 , Solaris 10, Ubuntu 9.10
Posts: 84

Rep: Reputation: 16
Angry Using KColorButton in QT application by QTCreator : linker error


Hi,

I am using OpenSuse 11.2 which I just installed.
I was working on one QT application in OpenSuse 10.3 with few KColorButton in it and it was compiling fine under that dist.


Now after copying the project to 11.2 environment , I can't make the project .
It's now throwing linker error :

Quote:
Starting: /usr/bin/make -w
make: Entering directory `/home/aniruddha/ChatServer'
g++ -c -m64 -pipe -g -Wall -W -D_REENTRANT -DQT_QT3SUPPORT_LIB -DQT3_SUPPORT -DQT_SQL_LIB -DQT_GUI_LIB -DQT_NETWORK_LIB -DQT_CORE_LIB -DQT_SHARED -I/usr/share/qt4/mkspecs/linux-g++-64 -I. -I/usr/include/QtCore -I/usr/include/QtNetwork -I/usr/include/QtGui -I/usr/include/QtSql -I/usr/include/Qt3Support -I/usr/include -I. -I. -o chatwindow.o chatwindow.cpp
g++ -m64 -o ChatServer main.o chatwindow.o moc_chatwindow.o -L/usr/lib64 -lQt3Support -L/usr/lib64 -pthread -pthread -pthread -pthread -lQtXml -pthread -pthread -pthread -pthread -L/usr/X11R6/lib64 -pthread -pthread -pthread -pthread -pthread -pthread -pthread -pthread -pthread -pthread -pthread -pthread -lQtSql -pthread -pthread -lQtGui -pthread -lpng -lfreetype -lSM -lICE -pthread -pthread -lXrender -lXrandr -lXfixes -lXcursor -lXinerama -lfontconfig -lXext -lX11 -lQtNetwork -pthread -pthread -lQtCore -lz -lm -pthread -lgthread-2.0 -lrt -lglib-2.0 -ldl -lpthread
make: Leaving directory `/home/aniruddha/ChatServer'
chatwindow.o: In function `Ui_ChatWindow::setupUi(QMainWindow*)':
/home/aniruddha/ChatServer/ui_chatwindow.h:69: undefined reference to `KColorButton::KColorButton(QWidget*)'
/home/aniruddha/ChatServer/ui_chatwindow.h:73: undefined reference to `KColorButton::setColor(QColor const&)'
collect2: ld returned 1 exit status
make: *** [ChatServer] Error 1
Exited with code 2.
Error while building project ChatServer


I thought there was some problem while porting my application to QT 4.3.2 (current build) .

So I created a demo project using Qt Creator with a KColorButton and I recreated the linker cache , but it also shows same symptom.

Is this Qt build broken ? Or /usr/lib64/kde4/plugins/designer/kdewidgets.so library missing from current linker cache ?



Any other way to fix this issue ?

Last edited by thandermax; 01-11-2010 at 10:34 AM.
 
Old 01-11-2010, 10:33 AM   #2
thandermax
Member
 
Registered: Jun 2005
Distribution: OpenSUSE 10.3 , 11.2 , Solaris 10, Ubuntu 9.10
Posts: 84

Original Poster
Rep: Reputation: 16
Exclamation Still error !

I tried adding
/usr/lib64/kde4/plugins/designer/kdewidgets.so to g++ argument . It compiled fine but throws another linker error while lunching the app :

Quote:

Starting /home/aniruddha/ChatServer/ChatServer...
/home/aniruddha/ChatServer/ChatServer: error while loading shared libraries: kdewidgets.so: cannot open shared object file: No such file or directory

/home/aniruddha/ChatServer/ChatServer exited with code 127

 
Old 01-11-2010, 10:52 AM   #3
thandermax
Member
 
Registered: Jun 2005
Distribution: OpenSUSE 10.3 , 11.2 , Solaris 10, Ubuntu 9.10
Posts: 84

Original Poster
Rep: Reputation: 16
Smile Solved

Got it !



Quote:
Originally Posted by thandermax View Post
I tried adding
/usr/lib64/kde4/plugins/designer/kdewidgets.so to g++ argument . It compiled fine but throws another linker error while lunching the app :


Starting /home/aniruddha/ChatServer/ChatServer...
/home/aniruddha/ChatServer/ChatServer: error while loading shared libraries: kdewidgets.so: cannot open shared object file: No such file or directory

/home/aniruddha/ChatServer/ChatServer exited with code 127




Added the shared library to makefile LIBS variable.
LIBS = $(SUBLIBS) /usr/lib64/kde4/plugins/designer/kdewidgets.so -L/usr/lib64 ... ...


And the problem with not loading the shared library while lunching the application was because of not setting LD_LIBRARY_PATH to point correct shared library path .


Changed LD_LIBRARY_PATH to include /usr/lib64/kde4/plugins/designer also and my application loaded successfully .

Credit goes to An Introduction to GCC - for the GNU compilers gcc and g++
 
  


Reply

Tags
error, linker


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] cryptic linker error (i really dont like linker errors); smeezekitty Programming 2 09-19-2009 03:21 AM
linker error pavan Programming 2 10-06-2005 02:58 AM
ld linker error Ankit mittal Programming 2 09-30-2005 08:40 AM
Linker error eddydw Linux - General 0 09-20-2004 02:21 PM
linker error Config Programming 8 06-04-2002 04:33 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 05:28 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration