PDA

View Full Version : Qt 4.2.2 and SuSE Linux 9.3



Teuniz
18th February 2007, 12:20
I configured Qt 4.2.2 like this:

./configure -static -release -no-qt3support -qt-zlib -qt-gif -qt-libpng -qt-libmng -qt-libjpeg

then:

make sub-src

then (as root):

cp -r qt_src/bin /usr/local/Trolltech/Qt-4.2.2/bin
cp -r qt_src/include /usr/local/Trolltech/Qt-4.2.2/include
cp -r qt_src/lib /usr/local/Trolltech/Qt-4.2.2/lib
cp -r qt_src/mkspecs /usr/local/Trolltech/Qt-4.2.2/mkspecs
cp -r qt_src/src /usr/local/Trolltech/Qt-4.2.2/src
cp -r qt_src/doc /usr/local/Trolltech/Qt-4.2.2/doc

in my ~/.profile I added:

export PATH="$PATH:/usr/local/Trolltech/Qt-4.2.2/bin"

Everything went well so far, except...

When I try to compile even the most simple/basic progam,
I get this error message:

teuniz@linux:~/c/nk2edf-0.42beta-src> make
g++ -c -pipe -O2 -Wall -W -D_REENTRANT -DQT_NO_DEBUG -DQT_GUI_LIB -DQT_CORE_LIB -I/usr/local/Trolltech/Qt-4.2.2/mkspecs/linux-g++ -I. -I/usr/local/Trolltech/Qt-4.2.2/include/QtCore -I/usr/local/Trolltech/Qt-4.2.2/include/QtCore -I/usr/local/Trolltech/Qt-4.2.2/include/QtGui -I/usr/local/Trolltech/Qt-4.2.2/include/QtGui -I/usr/local/Trolltech/Qt-4.2.2/include -I. -Imoc -I. -o objects/main.o main.cpp
In file included from /usr/local/Trolltech/Qt-4.2.2/include/QtCore/qglobal.h:1,
from /usr/local/Trolltech/Qt-4.2.2/src/corelib/global/qnamespace.h:27,
from /usr/local/Trolltech/Qt-4.2.2/include/QtCore/qnamespace.h:1,
from /usr/local/Trolltech/Qt-4.2.2/src/corelib/kernel/qobjectdefs.h:27,
from /usr/local/Trolltech/Qt-4.2.2/include/QtCore/qobjectdefs.h:1,
from /usr/local/Trolltech/Qt-4.2.2/src/corelib/kernel/qobject.h:29,
from /usr/local/Trolltech/Qt-4.2.2/include/QtCore/qobject.h:1,
from /usr/local/Trolltech/Qt-4.2.2/src/corelib/kernel/qcoreapplication.h:27,
from /usr/local/Trolltech/Qt-4.2.2/include/QtCore/qcoreapplication.h:1,
from /usr/local/Trolltech/Qt-4.2.2/src/gui/kernel/qapplication.h:27,
from /usr/local/Trolltech/Qt-4.2.2/include/QtGui/qapplication.h:1,
from /usr/local/Trolltech/Qt-4.2.2/include/QtGui/QApplication:1,
from main.cpp:3:
/usr/local/Trolltech/Qt-4.2.2/src/corelib/global/qglobal.h:38:28: QtCore/qconfig.h: No such file or directory
/usr/local/Trolltech/Qt-4.2.2/src/corelib/global/qglobal.h:1075:6: #error "Qt not configured correctly, please run configure"
/usr/local/Trolltech/Qt-4.2.2/src/corelib/global/qglobal.h:1861:6: #error "Qt not configured correctly, please run configure"

I checked the dir /usr/local/Trolltech/Qt-4.2.2/src/corelib/global/ and the file qconfig.h is present!

When I do the same install and configuration on a box with SuSE 10.0 or OpenSUSE 10.2 everything works well (using the same sourcecode).

I hope somebody can solve this mysterie...

Tnx in advance,

Teuniz

jacek
18th February 2007, 13:23
I checked the dir /usr/local/Trolltech/Qt-4.2.2/src/corelib/global/ and the file qconfig.h is present!
Maybe there is some problem with access rights?

Teuniz
18th February 2007, 13:32
teuniz@linux:/usr/local/Trolltech/Qt-4.2.2/src/corelib/global> ls -l
total 312
-rw-r--r-- 1 root root 371 2007-02-17 18:30 global.pri
-r--r--r-- 1 root root 8332 2007-02-17 18:30 qconfig.cpp
-rw-r--r-- 1 root root 1404 2007-02-17 18:30 qconfig-dist.h
-r--r--r-- 1 root root 1471 2007-02-17 18:30 qconfig.h
-rw-r--r-- 1 root root 48 2007-02-17 18:30 qconfig.h.qmake
-rw-r--r-- 1 root root 3111 2007-02-17 18:30 qconfig-large.h
-rw-r--r-- 1 root root 4989 2007-02-17 18:30 qconfig-medium.h
-rw-r--r-- 1 root root 9057 2007-02-17 18:30 qconfig-minimal.h
-rw-r--r-- 1 root root 5766 2007-02-17 18:30 qconfig-small.h
-rw-r--r-- 1 root root 10786 2007-02-17 18:30 qendian.h
-rw-r--r-- 1 root root 14767 2007-02-17 18:30 qfeatures.h
-rw-r--r-- 1 root root 22748 2007-02-17 18:30 qfeatures.txt
-rw-r--r-- 1 root root 66476 2007-02-17 18:30 qglobal.cpp
-rw-r--r-- 1 root root 57690 2007-02-17 18:30 qglobal.h
-rw-r--r-- 1 root root 14615 2007-02-17 18:30 qlibraryinfo.cpp
-rw-r--r-- 1 root root 1808 2007-02-17 18:30 qlibraryinfo.h
-rw-r--r-- 1 root root 41332 2007-02-17 18:30 qnamespace.h
-rw-r--r-- 1 root root 4056 2007-02-17 18:30 qnumeric_p.h
-rw-r--r-- 1 root root 1738 2007-02-17 18:30 qt_pch.h
teuniz@linux:/usr/local/Trolltech/Qt-4.2.2/src/corelib/global>

jacek
18th February 2007, 13:39
/usr/local/Trolltech/Qt-4.2.2/src/corelib/global/qglobal.h:38:28: QtCore/qconfig.h: No such file or directory
Do you have /usr/local/Trolltech/Qt-4.2.2/include/QtCore/qconfig.h?


teuniz@linux:/usr/local/Trolltech/Qt-4.2.2/src/corelib/global> ls -l
...
They look OK, what about directories?

wysota
18th February 2007, 13:40
Why compiling an app reffers to Qt sources? Something was messed up during compiling Qt. I guess you should have done make install instead of manually copying Qt files. You can use the prefix option in configure to decide where to install Qt files.

Teuniz
18th February 2007, 14:02
I guess you should have done make install instead of manually copying Qt files.

http://wiki.qtcentre.org/index.php?title=Building_static_Qt_on_Linux

Teuniz
18th February 2007, 14:09
They look OK, what about directories?

teuniz@linux:/usr/local/Trolltech/Qt-4.2.2/src/corelib> ls -l
total 436
drwxr-xr-x 16 root root 856 2007-02-17 18:30 arch
drwxr-xr-x 2 root root 688 2007-02-17 18:30 codecs
-rw-r--r-- 1 root root 571 2007-02-17 18:30 corelib.pro
drwxr-xr-x 2 root root 656 2007-02-17 18:30 global
drwxr-xr-x 2 root root 1648 2007-02-17 18:30 io
drwxr-xr-x 2 root root 1992 2007-02-17 18:30 kernel
-rw-r--r-- 1 root root 432997 2007-02-17 18:30 Makefile
drwxr-xr-x 2 root root 496 2007-02-17 18:30 plugin
drwxr-xr-x 2 root root 704 2007-02-17 18:30 thread
drwxr-xr-x 2 root root 2032 2007-02-17 18:30 tools
teuniz@linux:/usr/local/Trolltech/Qt-4.2.2/src/corelib> cd ..
teuniz@linux:/usr/local/Trolltech/Qt-4.2.2/src> ls -l
total 55
drwxr-xr-x 11 root root 312 2007-02-17 18:31 3rdparty
drwxr-xr-x 12 root root 344 2007-02-17 18:30 corelib
drwxr-xr-x 19 root root 536 2007-02-17 18:30 gui
-rw-r--r-- 1 root root 270 2007-02-17 18:30 libqt.map
-rw-r--r-- 1 root root 25779 2007-02-17 18:30 Makefile
drwxr-xr-x 4 root root 1376 2007-02-17 18:31 network
drwxr-xr-x 5 root root 736 2007-02-17 18:31 opengl
drwxr-xr-x 10 root root 368 2007-02-17 18:31 plugins
-rw-r--r-- 1 root root 4338 2007-02-17 18:31 qbase.pri
drwxr-xr-x 14 root root 400 2007-02-17 18:31 qt3support
-rw-r--r-- 1 root root 908 2007-02-17 18:31 qt_install.pri
-rw-r--r-- 1 root root 193 2007-02-17 18:31 qt_targets.pri
drwxr-xr-x 7 root root 248 2007-02-17 18:30 sql
-rw-r--r-- 1 root root 3256 2007-02-17 18:30 src.pro
drwxr-xr-x 4 root root 832 2007-02-17 18:30 svg
drwxr-xr-x 6 root root 144 2007-02-17 18:30 tools
drwxr-xr-x 4 root root 240 2007-02-17 18:30 xml
teuniz@linux:/usr/local/Trolltech/Qt-4.2.2/src> cd ..
teuniz@linux:/usr/local/Trolltech/Qt-4.2.2> ls -l
total 3
drwxr-xr-x 2 root root 192 2007-02-17 18:28 bin
drwxr-xr-x 3 root root 72 2007-02-17 18:31 doc
drwxr-xr-x 17 root root 448 2007-02-17 18:29 include
drwxr-xr-x 2 root root 1368 2007-02-17 18:29 lib
drwxr-xr-x 54 root root 1648 2007-02-17 18:30 mkspecs
drwxr-xr-x 14 root root 520 2007-02-17 18:31 src
sabrina@linux:/usr/local/Trolltech/Qt-4.2.2> cd ..
sabrina@linux:/usr/local/Trolltech> ls -l
total 0
drwxr-xr-x 8 root root 192 2007-02-17 18:31 Qt-4.2.2
teuniz@linux:/usr/local/Trolltech>

jacek
18th February 2007, 15:55
Directories look OK too. What about that /usr/local/Trolltech/Qt-4.2.2/include/QtCore/qconfig.h file?

Teuniz
18th February 2007, 16:19
I deleted all the Qt stuff and I did the whole procedure (downloading, unpacking, configuring and copying Qt) again like I did before.
And now it works... :confused:

I guess there was a glitch in the comp or I entered a cmd wrong... :o

Tnx for the help and sorry for bothering.

Teuniz
22nd February 2007, 10:51
I discovered what caused this problem. After I copied all the relevant files to /usr/local/Trolltech/Qt-4.2.2/ I deleted the directory where I unzipped, configured and
compiled Qt. For some strange reason which only Trolltech knows, qmake has a hardcoded path to the local dir qt_src/src.
Copying qt_src/src to /usr/local/Trolltech/Qt-4.2.2/src doesn't help. Obviously you can't delete the qt_src dir, at least you need to keep qt-src/src :(

http://wiki.qtcentre.org/index.php?title=Building_static_Qt_on_Linux

wysota
22nd February 2007, 12:30
Obviously you can't delete the qt_src dir, at least you need to keep qt-src/src :(

http://wiki.qtcentre.org/index.php?title=Building_static_Qt_on_Linux

IMO you just need to set an appropriate prefix while recompiling Qt.

Teuniz
22nd February 2007, 13:16
IMO you just need to set an appropriate prefix while recompiling Qt.

You mean this one?

Installation options:

These are optional, but you may specify install directories.

-prefix <dir> ...... This will install everything relative to <dir>
(default /usr/local/Trolltech/Qt-4.2.2)

* -prefix-install .... Force a sandboxed "local" installation of
Qt. This will install into
/usr/local/Trolltech/Qt-4.2.2, if this option is
disabled then some platforms will attempt a
"system" install by placing default values to
be placed in a system location other than
PREFIX.


-prefix-install is enabled by default according to "configure -help".

Any other suggestions?

wysota
23rd February 2007, 01:38
The point is to use a different prefix than your shared installation has and to call make install to install the static version there. You should end up with two distinct Qt trees, one shared and one static. You can then try to link the two trees together, for example by substituting the include directory with a link to the include directory of the other tree, etc. You should be able to do the same with the doc, mkspecs, translations and phrasebooks directories. And you can delete demos and examples as you probably won't need static versions of those. Note that I'm talking about full compilation here, not only about compiling sub-src. For sub-src you probably won't have some of the directories at all.

Teuniz
23rd February 2007, 09:02
The point is to use a different prefix than your shared installation has and to call make install to install the static version there.

That's the point, I don't have a shared installation, I don't use the command "make install".
Look at the procedure I used in my first post. The reason is that compiling all the stuff takes more time, specially when you want to link static and I don't need need the shared libs anyway. My programs have to run on many distro's.

According to AMan in his article http://wiki.qtcentre.org/index.php?title=Building_static_Qt_on_Linux you can not use "make install" when you need to link static.

wysota
23rd February 2007, 20:41
That's the point, I don't have a shared installation
There is no problem then. But sub-src won't be enough, for example Designer and Assistant won't be built.


According to AMan in his article http://wiki.qtcentre.org/index.php?title=Building_static_Qt_on_Linux you can not use "make install" when you need to link static.
Have you tried?
According to me it may only apply when having static and shared installations side by side to avoid overwriting one with the other.

Teuniz
26th February 2007, 13:21
Somebody from Trolltech was so kind to solve my problem.
You can find the solution here: http://wiki.qtcentre.org/index.php?title=Building_static_Qt_on_Linux

Regards.