[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-devel
Subject:    Re: Where the libqt.a is?
From:       Kurt Granroth <granroth () suse ! com>
Date:       2001-04-19 1:27:17
[Download RAW message or body]

P Neiros wrote:
> 1. These are two cases of the compilation: (khi is my
> program)
>  
>  At the first time, I wrote:
> 
>  linux:~/Projects # g++  khi.cpp -I/opt/kde2/include
>  -I/usr/lib/qt-2.3.0/include
>  -L$KDEDIR/lib -lkdeui -lkdecore -ldl -lqt
>  /usr/i486-suse-linux/bin/ld: cannot find -lqt
>  collect2: ld returned 1 exit status
[snip lots of stuff]

You are making SO MUCH more complicated than it has to be!

First, stop looking for '.a' files.  Those are for static libraries
and as I said before, you don't want to use those.

If you are going to program KDE apps, I strongly suggest that you
start with a "template" generated by either kapptemplate or KDevelop.
Both will take care of all of the library paths and things like that.

If you insist on doing it by hand.. well, that's pretty simple for
simple cases like this

Try this first:

 # g++ khi.cpp -I$KDEDIR/include -I$QTDIR/include -L$KDEDIR/lib \
   -I$QTDIR/lib -lkdeui

This will work on many systems because libkdeui actually has RPATHs to
all of the libraries it depends on.  If this doesn't work, then
satisfy a few more deps:

 # g++ khi.cpp -I$KDEDIR/include -I$QTDIR/include -L$KDEDIR/lib \
   -I$QTDIR/lib -lkdeui -lkdecore -lqt

This will almost surely work.  On a very strangly setup system, you
may need to specify -ldl.  You probably won't, though.

No matter what, you will never need to specify -lg++ or -lgcc or any
library even remote like that!

But I go back to recommending that you create your application
template using kapptemplate or KDevelop.
-- 
Kurt Granroth            | http://www.granroth.org
KDE Developer/Evangelist | SuSE Labs Open Source Developer
granroth@kde.org         | granroth@suse.com
            KDE -- Conquer Your Desktop
 
>> Visit http://master.kde.org/mailman/listinfo/kde-devel#unsub to unsubscribe <<

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic