FAQ! For all who´ve got troubles with Qt versions

Falk Brettschneider gigafalk at yahoo.com
Tue Feb 8 22:21:35 GMT 2000


Hi,

Since many people have got problems with Qt when developing with Qt or
when recompiling Kdevelop1.1 itself, I want to try to give a check list
or a guide what´s needed to do:
Anyway it works for me :-)

--------------------------------------------
1. Check the Qt versions:
---------------------------
* You should find:
/usr/lib/qt --> /usr/lib/qt
/usr/lib/qt --> a symbolic link to the Qt version you want to use

/usr/lib/qt-1.44   (required for running KDevelop itself!
                    also required for compiling KDE1 applications)
/usr/lib/qt-2.0.0  (required for developing Qt-2.0.2 applications)
/usr/lib/qt-2.1    (required for developing Qt-2.1 applications and
                    also required for creating KDE2 applications)

The directories from above should contain at least a 'lib' and an
'include' directory. That´s all what the compiler/linker needs.

* Furthermore there have to be a few lines in /etc/ld.so.conf:
---snip--ld.so.conf---
/usr/lib/qt-1.44/lib
/usr/lib/qt-2.0.2/lib
/usr/lib/qt-2.1/lib
---snap--ld.so.conf---
There should be no line: /usr/lib/qt
That file ld.so.conf contains the information about places where Unix
can find the needed Qt library at runtime of your created Qt or KDE
application. ld.so.conf is read in at computer boot time. After changes
on that file or if you´re not sure if your system considers the
settings, just call (as root):
  ldconfig -v
to force a new processing of ld.so.conf.
BTW: If you don´t use Qt-2.1, the appropriate lines are redundant. Pay
attention: KDevelop needs Qt-1.44! So don´t remove the Qt-1.44 settings.

* Check if /usr/lib/qt.../lib contains only the appropriate lib
* Check if /usr/lib/qt.../include contains the header files.

2. Reset the KDevelop settings
--------------------------------
- Go to 'Development' in the K menu of your desktop.
- Start 'Setup'
- The Setup procedure will ask your for the Qt documentation. Select the
documentation folder of the Qt version you want to develop for.
- The Setup procedure will ask your for the KDE documentation. Select
the documentation folder of the KDE version you want to develop for. If
you don´t want to program for KDE, you can ignore that question and skip
by pressing 'Cancel' in Setup.

After the Setup program KDevelop comes up and is ready to use for
developing Qt apps of the Qt version you have chosen with your
/usr/lib/qt link.

- Additionally check the settings again by looking at the KDevelop
options dialog (available via main menu). Check the documentation tab
and the path tab.

==============================================================
==============================================================

3.a) Developing Qt applications created by KDevelop´s project wizard
--------------------------------------------------------------------
Qt-1.44:

/usr/lib/qt has to point to /usr/lib/qt-1.44 !
KDevelop settings:
- Qt documentation path: /usr/lib/qt-1.44/html

Qt-2.0.2:

KDevelop settings (KDevelop->Options->KDevelop Setup):
- Qt documentation path: /usr/lib/qt-2.0.2/doc
- Qt path: /usr/lib/qt-2.0.2

Qt-2.1:

KDevelop settings (KDevelop->Options->KDevelop Setup):
- Qt documentation path: /usr/lib/qt-2.1/html
- Qt path: /usr/lib/qt-2.1

If you´re not sure or if you´ve got problems, do that in the 'Build'
menu of KDevelop:
* call 'DistClean' to remove all temporary project files
* remove config.cache from your project´s root directory
* call 'autoconf and automake' to regenerate all Makefile.in files
* call 'configure' to regenerate all Makefiles
  If your in doubt, add (e.g. for Qt-2.0.2) the additional parameter
  --with-qt-dir=/usr/lib/qt-2.0.2
  and optionally (for KDE2 applications where the kde2 stuff is placed
in /opt/kde2):
  --prefix=/opt/kde2
  Anyway while running that 'configure' you should watch the output
messages
  whether your desired Qt version is used or not. There will appear
something
  like this (e.g. for Qt-2.0.2):
  Checking for Qt...libraries /usr/lib/qt-2.0.2/lib, headers
/usr/lib/qt-2.0.2/include

--> If you call 'Rebuild all' or 'Make' from KDevelop´s 'Build' menu,
    you should see the compiler messages in the output view:
    (e.g. for Qt-2.0.2)
      g++ ... -I/usr/lib/qt-2.0.2/include ...
    and the linker output:
      /bin/sh ../libtool --silent --mode=link g++  ...
-L/usr/lib/qt-2.0.2/lib
===========================================================================

3.b) For work with Customer projects (external Makefiles generated by
tmake):
-----------------------------------------------------------------------------
This environment variables must be set (in .bashrc):
export QTDIR=/usr/lib/qt


* Switching the Qt version:

If you want to use another Qt version than you did before, you only have
to redirect the /usr/lib/qt link. This is also possible at KDevelop
runtime.
For instance: (If you want to switch from Qt-1.44 to Qt-2.0.2)
  su root
  cd /usr/lib
  rm qt               // removing the link to qt-1.44
  ln -s qt-2.0.2 qt   // creating a link to qt-2.0.2
========================================================


Hope that help,
  Falk



__________________________________________________
Do You Yahoo!?
Talk to your friends online with Yahoo! Messenger.
http://im.yahoo.com




More information about the KDevelop mailing list