ProgrammingThis forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.
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.
/home/pathfinder/tmp/cc1c18ms.o(.gnu.linkonce.r._ZTV6QGList+0xc): undefined reference to `QGList::clear()'
/home/pathfinder/tmp/cc1c18ms.o(.gnu.linkonce.r._ZTV6QGList+0x10): undefined reference to `QGList::~QGList()'
/home/pathfinder/tmp/cc1c18ms.o(.gnu.linkonce.r._ZTV6QGList+0x14): undefined reference to `QGList::~QGList()'
/home/pathfinder/tmp/cc1c18ms.o(.gnu.linkonce.r._ZTV6QGList+0x18): undefined reference to `QPtrCollection::newItem(void*)'
/home/pathfinder/tmp/cc1c18ms.o(.gnu.linkonce.r._ZTV6QGList+0x20): undefined reference to `QGList::compareItems(void*, void*)'
/home/pathfinder/tmp/cc1c18ms.o(.gnu.linkonce.r._ZTV6QGList+0x24): undefined reference to `QGList::read(QDataStream&, void*&)'
/home/pathfinder/tmp/cc1c18ms.o(.gnu.linkonce.r._ZTV6QGList+0x28): undefined reference to `QGList::write(QDataStream&, void*) const'
/home/pathfinder/tmp/cc1c18ms.o(.gnu.linkonce.r._ZTI6QGList+0x8): undefined reference to `typeinfo for QPtrCollection'
collect2: ld returned 1 exit status
Read up about how to compile programs for whatever system you're using. The people who write that stuff don't expect you to just know so it must be documented somewhere. pkg-config can help you if you know what libraries you're using. I mean, if you're developing for KDE or in Qt (or both) you must have some idea of what libraries you're supposed to be using?!
I'v only compiled really simple programs before.. I know where to find qlist.h (it's in /usr/lib/qt3/include). It has the functions in it the compiler is bitching about.
It's not the header file it wants, it's the library. Usually you use something like pkg-config to fill in the bits you need.
pkg-config --cflags --libs qt-mt
does it for Qt for me, but you may need other options to get the KDE specific libs/cflags. Put the above line in backticks (below the esc key) as part of your gcc line:
Code:
gcc main.c -o main `pkg-config --cflags --libs qt-mt`
qt-mt.pc is located in /usr/lib/qt3/lib/pkgconfig/. Do I need to pass this directory somehow?
No, you're trying to pass qt-mt.pc to the linker...that's the file used by pkgconfig, not the linker!!!
Ok, the last example I gave you...those are NOT quote marks around pkg-config (etc) they are backticks. On a US keyboard that's the key under the escape key, to the left of the 1 key.
Find some tutorial documentation for whatever system you're using (looks like Qt with some KDE specific stuff) and find out what flags you need to pass to the compiler. www.trolltech.com has a Qt tutorial which shows you how to compile their stuff, and if you search for kde programming tutorial you'll probably find something useful. I can't give any specific references, I hated programming with Qt and it's awful 'meta object compiler'
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.