QT Programming with Debian or Ubuntu Linux - a problem

Click For Summary

Discussion Overview

The discussion revolves around issues related to setting up Qt programming environments on Debian-based Linux distributions, specifically Kubuntu Hardy Heron. Participants explore the organization of Qt libraries and includes, the necessity of compiling Qt from source, and the configuration of environment variables like QTDIR and KDEDIR for successful compilation of source code.

Discussion Character

  • Technical explanation
  • Debate/contested
  • Homework-related

Main Points Raised

  • One participant expresses frustration over the distribution of Qt libraries and includes across different directories, complicating the setting of QTDIR without compiling from source.
  • Another participant suggests that it is unnecessary to compile Qt from source and recommends installing the development packages via Synaptic, mentioning the location of Qt in /usr/share/qt4.
  • A later reply proposes using the configure script with a specific flag to set QTDIR, indicating that symlinks in the suggested directory can help the compiler locate the necessary libraries and includes.
  • One participant notes that the issue arises primarily when compiling code from tutorials or books, as opposed to code that comes with a configure script.
  • A participant later identifies that compile errors are related to KDE rather than Qt and mentions the need to set KDEDIR similarly to how QTDIR was set.
  • Another participant confirms that setting KDEDIR resolved their issues and plans to add both QTDIR and KDEDIR to their PATH in their .bashrc file.

Areas of Agreement / Disagreement

Participants do not reach a consensus on the necessity of compiling Qt from source, as some argue it is unnecessary while others express a need for it due to library organization issues. The discussion includes both agreement on the solution for KDE and differing views on the initial problem with Qt.

Contextual Notes

Participants mention specific directory structures and configurations, but there are unresolved assumptions regarding the exact requirements for different projects and the implications of setting environment variables.

Pollywoggy
Messages
53
Reaction score
0
I am running Kubuntu Hardy Heron and I have the same problem I had with Debian, that the Qt packages put the libs and includes all over the place, not in one place such as /usr/lib and /usr/include

This means that I can't set QTDIR unless I obtain the Qt sources and compile and install in /usr/local/qt but that is a waste of disk space.

Is there a way to get source code requiring Qt to compile without having to install a second Qt?
 
Technology news on Phys.org
This sounds strange. Firstly, no, you don't need to compile Qt from source in order to install the libraries. Synaptic should have a list of the Qt packages - make sure you install the dev packages as well.

As far as I can recall, Hardy places Qt in /usr/share/qt4 (there are also Qt3 libraries in /usr/share/qt3, but presumably you're working with the latest Qt and don't need these). You don't say precisely what it is that you need to know $QTDIR for, but I'll assume you're trying to compile some sources that rely on the Qt libraries. Have you tried passing

Code:
./configure --with-qtdir=/usr/share/qt4

prior to building? There are symlinks in that directory that tell the compiler that the Qt libraries and includes are in /usr/share/lib and /usr/share/include.

Alternatively, you could always just set $QTDIR to the above in your .bashrc.
 
shoehorn said:
This sounds strange. Firstly, no, you don't need to compile Qt from source in order to install the libraries. Synaptic should have a list of the Qt packages - make sure you install the dev packages as well.

As far as I can recall, Hardy places Qt in /usr/share/qt4 (there are also Qt3 libraries in /usr/share/qt3, but presumably you're working with the latest Qt and don't need these). You don't say precisely what it is that you need to know $QTDIR for, but I'll assume you're trying to compile some sources that rely on the Qt libraries. Have you tried passing

Code:
./configure --with-qtdir=/usr/share/qt4

prior to building? There are symlinks in that directory that tell the compiler that the Qt libraries and includes are in /usr/share/lib and /usr/share/include.

Alternatively, you could always just set $QTDIR to the above in your .bashrc.

It's not a problem when I am compiling source code that comes with a configure script, the script knows where to find the libs and includes. It is a problem when I try to compile code from a tutorial or book.

I am going to try your suggestion of setting QTDIR to /usr/share/qt4

thanks
 
I think I am on the right track now and all the compile errors have to do with KDE and not Qt.
This means I need to do for KDE something along the lines of what I did for Qt, following the ideas you gave.

thanks
 
Solved

Pollywoggy said:
I think I am on the right track now and all the compile errors have to do with KDE and not Qt.
This means I need to do for KDE something along the lines of what I did for Qt, following the ideas you gave.

thanks

I set KDEDIR to /usr/lib/kde4 and this did the trick. I will put that in my ~/.bashrc and the QTDIR as well and also add the $QTDIR/bin and $KDEDIR/bin to my PATH.
 
Good! Glad it helped.
 

Similar threads

  • · Replies 2 ·
Replies
2
Views
2K
  • · Replies 6 ·
Replies
6
Views
2K
  • · Replies 3 ·
Replies
3
Views
3K
  • · Replies 5 ·
Replies
5
Views
2K
Replies
10
Views
3K
Replies
2
Views
3K
  • · Replies 3 ·
Replies
3
Views
5K
Replies
4
Views
5K
  • · Replies 1 ·
Replies
1
Views
2K
  • · Replies 2 ·
Replies
2
Views
6K