Linux - GeneralThis Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
Next i type in qmake -project to build a .pro project file, then i trype in qmake to make a makefile. Finally i type in make to compile the project but i get back these errors
Code:
g++ -c -pipe -Wall -W -O2 -DQT_NO_DEBUG -I/home/jordan/qt3/mkspecs/linux-g++ -I. -I. -I/home/jordan/qt3/include -o main.o main.cpp
g++ -o qt main.o -L/usr/X11R6/lib -lXext -lX11 -lm
main.o(.text+0x1e): In function `main':
: undefined reference to `QApplication::QApplication(int&, char**)'
main.o(.text+0x31): In function `main':
: undefined reference to `QString::QString(char const*)'
main.o(.text+0x45): In function `main':
: undefined reference to `QPushButton::QPushButton(QString const&, QWidget*, char const*)'
main.o(.text+0x5d): In function `main':
: undefined reference to `QString::shared_null'
main.o(.text+0x68): In function `main':
: undefined reference to `QStringData::deleteSelf()'
main.o(.text+0x77): In function `main':
: undefined reference to `QPushButton::resize(int, int)'
main.o(.text+0x80): In function `main':
: undefined reference to `QApplication::setMainWidget(QWidget*)'
main.o(.text+0x88): In function `main':
: undefined reference to `QWidget::show()'
main.o(.text+0x90): In function `main':
: undefined reference to `QApplication::exec()'
main.o(.text+0x9b): In function `main':
: undefined reference to `QPushButton::~QPushButton()'
main.o(.text+0xa3): In function `main':
: undefined reference to `QApplication::~QApplication()'
main.o(.text+0xc7): In function `main':
: undefined reference to `QString::shared_null'
main.o(.text+0xd2): In function `main':
: undefined reference to `QStringData::deleteSelf()'
main.o(.text+0xe3): In function `main':
: undefined reference to `QApplication::~QApplication()'
main.o(.text+0xf7): In function `main':
: undefined reference to `QPushButton::~QPushButton()'
main.o(.gnu.linkonce.r._ZTV6QGList+0xc): undefined reference to `QGList::clear()'
main.o(.gnu.linkonce.r._ZTV6QGList+0x10): undefined reference to `QGList::~QGList()'
main.o(.gnu.linkonce.r._ZTV6QGList+0x14): undefined reference to `QGList::~QGList()'
main.o(.gnu.linkonce.r._ZTV6QGList+0x18): undefined reference to `QPtrCollection::newItem(void*)'
main.o(.gnu.linkonce.r._ZTV6QGList+0x20): undefined reference to `QGList::compareItems(void*, void*)'
main.o(.gnu.linkonce.r._ZTV6QGList+0x24): undefined reference to `QGList::read(QDataStream&, void*&)'
main.o(.gnu.linkonce.r._ZTV6QGList+0x28): undefined reference to `QGList::write(QDataStream&, void*) const'
main.o(.gnu.linkonce.r._ZTI6QGList+0x8): undefined reference to `typeinfo for QPtrCollection'
collect2: ld returned 1 exit status
make: *** [qt] Error 1
Iv done many searches and i cant figure out why this wont work.
First i must say i know nether Qt nor c++, and you should have postet this is programming(because most people there can answer much better than i do.)
It looks like it's something wrong with your code. Try to just compile some code from a tutorial, and see if it works..
The code looks ok, looks like qmake isnt finding the libs it needs. is $QTDIR/lib in /etc/ld.so.conf and have you run ldconfig since? also is $QTDIR set to the root of the qt installation?
did you compile it yourself or is it the original slack package. check /etc/profile.d/ for qt.sh and make sure /usr/lib/qt3/lib is in /etc/ld.so.conf ( the slack package should have taken care of this for you).
double check for the two things mentioned above and try it again ( I'm using the slack 10 package and after qmake -project, qmake, make it compiled and linked without a problem).
I don't have qt3 installed..
Guess that *might* be the threadstartes problem as well. As we get the exact same output when we try to compile to program...
looks like he compiled it himself because its picking up the includes and compiles but fails at the linking stage. Also jordban, if you compiled it yourself did you include thread support?
wait, did you compile it or install the slackware package?
If compiling, it has to be done a certain way (its not a standard ./configure,make, and make install) as for the standard slackware package, it sets up the environmental variables and library link paths for you so you shouldn't have many problems with that. Just for reference, here's how I compile qt:
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.