LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Ubuntu (https://www.linuxquestions.org/questions/ubuntu-63/)
-   -   QT Libraries (https://www.linuxquestions.org/questions/ubuntu-63/qt-libraries-473318/)

ecac 08-12-2006 03:34 PM

QT Libraries
 
Hello,

I am playing with Kubuntu to see if it will be a better fit for my laptop than my current FC5. First I want to know if I can run everything I need for my work, so I have created a virtual installation on another computer.

Some of my programs have to be compiled against QT libraries. For instance, one program has this line:
#include <qpainter.h>
On my Kubuntu installation I have this file on /usr/include/qt3/qpainter.h. I believe it is part of the libqt3-headers package.

However when I try to compile the code I get the error message "error: qpainter.h: No such file or directory".

On FC5 there are a couple of things that happen automatically that let me compile the code after installing the QT libraries:
  • The location of the libraries is defined on /etc/ld.so.conf.d/qt-i386.conf. The only line in there is /usr/lib/qt-3.3/lib.
  • The variable QTDIR is defined as /usr/lib/qt-3.3

So, after installing the QT libraries (qt-devel package) on FC5 I can compile my code without problems.

But on Kubuntu it seems that I need to configure some things manually. I have created the file /etc/ld.so.conf and added the line /usr/lib/qt3 and defined the variable QTDIR as /usr/lib/qt3 because that was the directory closest to what I expected. However I cannot compile the code.

I have 2 main questions:
  1. How do I set up Kubuntu so that I can compile code with references to QT libraries?
  2. How can I look into the contents of a package and also figure out which package a file belongs to? For instance, in FC5 the commands would be "rpm -ql qt-devel" and "rpm -qf /usr/lib/qt-3.3/include/qpainter.h".

Thank you very much for your help. Best regards,

Elias

Brian1 08-12-2006 10:02 PM

Which version of qt are you running under FC5?
rpm -qa | grep qt

Brian1

ecac 08-12-2006 10:40 PM

The versions of qt are:
qt-3.3.6-0.4.fc5
qt-devel-3.3.6-0.4.fc5
Thanks.

Elias

alred 08-13-2006 07:35 AM

although i never try qt but this is what i have done just now ::

i simply do an 'apt-get install qt3-examples' hoping that this will install the neccessary stuffs for future compilation of qt app ...

cd into "/usr/share/doc/qt3-examples/qt3-examples/" and ran './build-examples' and sucessfully compiled all the examples ...

theres a line in file "/usr/share/doc/qt3-examples/qt3-examples/build-examples" of
Code:

export QTDIR=/usr/share/qt3

you can try ::
dpkg-deb --contents /var/cache/apt/archives/some.deb
dpkg --search /usr/include/qt3/qpainter.h

and

http://www.debian.org/doc/FAQ/ch-pkgtools.en.html

or type 'file-roller' in terminal to extract and browse files ...



//hope this helps a little bit ...


.

Brian1 08-13-2006 10:29 AM

No idea as to the issue. Just wanted to make sure you did not have qt-3.3.6-11.1. I had similiar issues with that release. No issues with 3.3.6-11.0 or earlier versions. No issues with the one you have installed.

Sorry I couldn't be of more help.
Brian1

ecac 08-13-2006 03:28 PM

Brian1,

Thanks anyway.


alred,

Thanks for your tips. I've been trying to figure out the minimum amount of configuration I needed to get my code to compile on Kubuntu. I took out the /usr/lib/qt3 line from /etc/ld.so.conf, ran ldconfig as root, and redefined QTDIR as /usr/share/qt3. Unfortunately, this didn't help matters. So I installed qt3-examples as you suggested. After this the code that was giving me trouble compiled. However, some other code still didn't compile because I needed qapp.h. This was overcome by installing libqt3-compat-headers. After this I was able to compile all my code.

In looking for packages that I needed to install in order to have the required files I found this website extremely helpful: http://packages.ubuntu.com/. I don't think I know of a similar website for FC.

Again thank you very much for steering me toward the solution.

Best regards,

Elias

alred 08-13-2006 09:30 PM

you may also try to have a look at qt4 , it does come with libqt4-qt3support ...

both fc and ubuntu work well with the tedious way(and fun too) but i think package manager of all sorts is the way to go ... eg. in ubuntu 'apt-get gcc cpp g++' may solved *most* of the problems ...


//anyway , glad to hear that you got your problems solved ...

.


All times are GMT -5. The time now is 06:12 AM.