[Techtalk] Can't get there from here
Terri Oda
terri at zone12.com
Fri Mar 29 01:14:57 EST 2002
At 11:36 PM 28/03/02 -0500, Davis, Jennifer wrote:
>I am quickly getting the hang of this coding thing, but I feel really dopey
>when trying to get a simple KDE program to compile. There it is below, and
>below it is the output from the compiler. I just can't figure out what I'm
>doing, let alone figuring out what I'm doing wrong. I guess there is more
>to compiling QT/KDE than a simple command line. Could anyone offer me a
>push in the right direction to help me compile my first gui program?
I'd say you're almost certainly missing a library (that's what undefined
references are -- you've referred to things, but it doesn't know where to
find the actual code that goes with them)
I haven't compiled a QT program in ages, so I can't tell you which
library/libraries might be missing, but I'd guess it's probably named
something like libqt, so you'd fix this by adding the library to your
compile line something like this:
g++ -o test.exe test.cpp -lqt
where -lqt tells it to link in the library libqt.so, assuming it can find
it. Your qt libraries probably aren't anywhere too weird, so trying this
should just work.
If that's not the right library, you can usually figure out which one
*will* be the right library by looking up the man page for one of the
functions you're using.
Incidentally, 'test' tends to be a bad name for first programs on linux
systems because there's already a program called test and I've seen people
confused for ages as to why their program didn't seem to be working when,
in fact, they were running the 'test' program already provided and not
their new program! (your 'test.exe' should be fine, though, I was just
reminded when I was cutting and pasting the line.)
More information about the Techtalk
mailing list