Qt Forum - programming with C++ and Qt
Register Calendar Members List Team Members Search Frequently Asked Questions Go to the Main Page

Qt Forum - programming with C++ and Qt » QtForum.org » Qt » Qt Designer » Howto compile a project with a custom widget. » Hello Guest [Login|Register]
Last Post | First Unread Post Print Page | Recommend to a Friend | Add Thread to Favorites
Post New Thread Post Reply
Go to the bottom of this page Howto compile a project with a custom widget.
Author
Post « Previous Thread | Next Thread »
leoclog
Assistant


Registration Date: 10.04.2008
Posts: 5

Level: 6 [?]
Experience: 181
Next Level: 282

101 points of experience needed for next level

Daumen hoch! Howto compile a project with a custom widget. Reply to this Post Post Reply with Quote Edit/Delete Posts Report Post to a Moderator       Go to the top of this page

Hi,

I created a custom widget in designer and I'm now ready to use the widget in my other projects but I'm getting either compile issues or the program compiles but doesn't run due to the custom widget library.

I first used the custom widget without changing the .pro file and got the following error ;

code:
1:
2:
3:
4:
5:
6:
7:
>make
/usr/bin/qmake -unix -o Makefile currency.pro
g++  -o currency currency.o currxml.o main.o moc_currency.o    -L/usr/lib -lQtXml -L/usr/lib -pthread -pthread -lQtGui -L/usr/X11R6/lib -lpng -lSM -lICE -pthread -pthread -lXi -lXrender -lXrandr -lXfixes -lXcursor -lXinerama -lfreetype -lfontconfig -lXext -lX11 -lQtNetwork -pthread -pthread -lQtCore -lz -lm -pthread -lgthread-2.0 -lrt -lglib-2.0 -ldl -lpthread
currency.o: In function `Ui_Dialog::setupUi(QDialog*)':
currency.cpp:(.text._ZN9Ui_Dialog7setupUiEP7QDialog[Ui_Dialog::setupUi(QDialog*)]+0x750): undefined reference to `SelectDateWidget::SelectDateWidget(QWidget*)'
collect2: ld returned 1 exit status
make: *** [currency] Error 1


I then changed the .pro file and added :

code:
1:
LIBS += -L/usr/lib/qt4/plugins/designer -lselectdatewidget


Now the compile goes ok but when I run the program I get the following message

code:
1:
2:
>./currency
./currency: error while loading shared libraries: libselectdatewidget.so: cannot open shared object file: No such file or directory


What do I need to change to use my new custom widget?

I'm running Qt4.3 on a linux box.

Regards,

Leo Paalvast

This post has been edited 1 time(s), it was last edited by leoclog: 13.04.2008 21:17.

12.04.2008 18:17 leoclog is offline Send an Email to leoclog Search for Posts by leoclog Add leoclog to your Buddy List
Messenger Messenger is a male
Expert


Registration Date: 20.04.2007
Posts: 298
Location: Lt

Level: 26 [?]
Experience: 116,880
Next Level: 125,609

8,729 points of experience needed for next level

RE: Howto compile a project with a custom widget. Reply to this Post Post Reply with Quote Edit/Delete Posts Report Post to a Moderator       Go to the top of this page

>>./currency: error while loading shared libraries: libselectdatewidget.so: cannot open shared object file: No such file or directory
To run application use
LD_LIBRARY_PATH=/-L/usr/lib/qt4/plugins/designer ./yourprogram
or
LD_LIBRARY_PATH=./ ./yourprogram (and ibselectdatewidget.so in application directory)
Take a look at scripts loading opera, openoffice (soffice), firefox etc.
See /etc/ld.so.conf ldconfig etc.

Maybe it is possible to create static selectdtewidget library. Then application with selectdtewidget will not need external library (so). See qmake CONFIG variable staticlib option.

__________________
Fighting fire with fire.
13.04.2008 12:16 Messenger is offline Search for Posts by Messenger Add Messenger to your Buddy List
leoclog
Assistant


Registration Date: 10.04.2008
Posts: 5

Level: 6 [?]
Experience: 181
Next Level: 282

101 points of experience needed for next level

Thread Starter Thread Started by leoclog
RE: Howto compile a project with a custom widget. Reply to this Post Post Reply with Quote Edit/Delete Posts Report Post to a Moderator       Go to the top of this page

Thanks again messenger, I used the CONFIG += staticlib option and it works fine now,
13.04.2008 21:16 leoclog is offline Send an Email to leoclog Search for Posts by leoclog Add leoclog to your Buddy List
Tree Structure | Board Structure
Jump to:
Post New Thread Post Reply
Qt Forum - programming with C++ and Qt » QtForum.org » Qt » Qt Designer » Howto compile a project with a custom widget.

views today: 10.075 | views yesterday: 17.520 | total views: 10.243.444


Klebekork Shop - Linux Shop - Kontaktanzeigen - Linux Forum -  SMS Gewinnspiel -  Hotels -  Stadtpläne -  Branchenbuch & Stadtplan

Branchenbuch Österreich - Branchenbuch Niederlande - Portugal Branchenverzeichnis - Spanien Branchenverzeichnis 
Telefonbuch - Branchenbuch Frankreich