QT Programming with Debian or Ubuntu Linux - a problem

In summary, the conversation discusses the problem of the Qt packages being scattered throughout the system and not in a centralized location. The solution is to either set $QTDIR to /usr/share/qt4 or pass it as a parameter in the ./configure command when building sources. The same process can be applied to KDE by setting $KDEDIR to /usr/lib/kde4. Ultimately, the solution is to add the $QTDIR/bin and $KDEDIR/bin to the PATH in the .bashrc file.
  • #1
Pollywoggy
53
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
  • #2
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.
 
  • #3
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
 
  • #4
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
 
  • #5
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.
 
  • #6
Good! Glad it helped.
 

1. What is QT programming and how does it relate to Debian or Ubuntu Linux?

QT programming is a cross-platform application framework used for developing graphical user interfaces (GUIs) for software applications. It is commonly used on Linux systems, including Debian and Ubuntu, as it provides a set of libraries and tools for creating intuitive and visually appealing interfaces.

2. Is QT programming compatible with all versions of Debian and Ubuntu Linux?

Yes, QT programming is compatible with all versions of Debian and Ubuntu Linux. It is an open-source framework that can be used on any Linux distribution, as well as on other operating systems such as Windows and macOS.

3. What are the advantages of using QT programming with Debian or Ubuntu Linux?

One of the main advantages of using QT programming with Debian or Ubuntu Linux is its cross-platform compatibility. This means that applications developed with QT can run on multiple operating systems without having to make significant changes to the code. Additionally, QT offers a wide range of features and tools for creating modern and user-friendly interfaces.

4. Are there any limitations or drawbacks to using QT programming with Debian or Ubuntu Linux?

While QT programming is a popular choice for developing GUIs on Linux systems, it does have some limitations. QT is primarily designed for developing graphical applications, so it may not be the best choice for projects that require heavy processing or data manipulation. Additionally, some users may find the learning curve for QT programming to be steeper compared to other programming languages.

5. Can beginners learn QT programming for Debian or Ubuntu Linux?

Yes, beginners can learn QT programming for Debian or Ubuntu Linux. QT offers comprehensive documentation and tutorials for beginners, making it accessible even for those who are new to programming. There are also many online resources and communities available for support and assistance.

Similar threads

  • Programming and Computer Science
Replies
2
Views
1K
  • Nuclear Engineering
Replies
6
Views
1K
  • Computing and Technology
Replies
5
Views
261
Replies
2
Views
2K
  • Programming and Computer Science
Replies
4
Views
3K
  • Programming and Computer Science
Replies
4
Views
3K
  • Programming and Computer Science
Replies
2
Views
312
  • Programming and Computer Science
Replies
4
Views
4K
  • Programming and Computer Science
Replies
2
Views
2K
  • Programming and Computer Science
Replies
1
Views
2K
Back
Top