LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Programming (https://www.linuxquestions.org/questions/programming-9/)
-   -   installing qt4 (https://www.linuxquestions.org/questions/programming-9/installing-qt4-361530/)

fakie_flip 09-08-2005 04:22 PM

installing qt4
 
I do not have KDE, so my Ubuntu on my computer did not have QT already. I installed QT in a .tar.gz file. Is that source code? I followed the instructions right to install it. When I try to compile a HelloWorld.cpp from the qt tutorial with g++, I am getting errors that my include files (they are supposed to come from the QT library) do not exist. I know adding the qt bin to the path did work because I can type rcc and get options. I had some compile errors at the end when I typed the command make.

yogeshm02 09-09-2005 09:29 AM

Here are partial contents of my .bashrc: -
QTDIR=/usr/local/qt
PATH=$QTDIR/bin:$PATH
LD_LIBRARY_PATH=$QTDIR/lib:$LD_LIBRARY_PATH
export QTDIR PATH LD_LIBRARY_PATH

Having set-up as above (changing path where necessary), change to your source directory and to the following: -
qmake -project myproject.pro
qmake -makefile myproject.pro
make

fakie_flip 09-09-2005 04:06 PM

I added that at the bottom of my .bashrc and changed it to the correct path for my system. I typed the first command with qmake, and it did not work. I looked in the bin directory for qt4, and qmake was not there. Is x-11 the right download, or was I supposed to get the download for embedded Linux? I do not know what those are for. I am not using qt for commercial software.

fakie_flip 09-09-2005 10:25 PM

I just tried to install qt4.0.1 again. I got these same errors as before from the make command. Here are some of them:

Code:

11-opensource-src-4.0.1/lib -lpthread -ldl
ln -s libQtCore.so.4.0.1 libQtCore.so
ln -s libQtCore.so.4.0.1 libQtCore.so.4
ln -s libQtCore.so.4.0.1 libQtCore.so.4.0
rm -f ../../lib/libQtCore.so.4.0.1
rm -f ../../lib/libQtCore.so
rm -f ../../lib/libQtCore.so.4
rm -f ../../lib/libQtCore.so.4.0
mv -f libQtCore.so.4.0.1 libQtCore.so libQtCore.so.4 libQtCore.so.4.0 ../../lib/make[3]: Leaving directory `/tmp/qt-x11-opensource-src-4.0.1/src/corelib'
make[2]: Leaving directory `/tmp/qt-x11-opensource-src-4.0.1/src/corelib'
cd xml && make
make[2]: Entering directory `/tmp/qt-x11-opensource-src-4.0.1/src/xml'
make -f Makefile.Debug all
make[3]: Entering directory `/tmp/qt-x11-opensource-src-4.0.1/src/xml'
g++ -c -pipe -g -Wall -W -D_REENTRANT -fPIC -DQT_SHARED -DQT_EDITION=QT_EDITION_DESKTOP -DQT_BUILD_XML_LIB -DQT_NO_CAST_TO_ASCII -DQT3_SUPPORT -DQT_MOC_COMPAT -DQT_CORE_LIB -D_LARGEFILE64_SOURCE -D_LARGEFILE_SOURCE -I../../mkspecs/linux-g++ -I. -I../../include/QtCore -I../../include -I../../include/QtXml -I.moc/debug-shared -I. -o .obj/debug-shared/qxml.o qxml.cpp
g++ -c -pipe -g -Wall -W -D_REENTRANT -fPIC -DQT_SHARED -DQT_EDITION=QT_EDITION_DESKTOP -DQT_BUILD_XML_LIB -DQT_NO_CAST_TO_ASCII -DQT3_SUPPORT -DQT_MOC_COMPAT -DQT_CORE_LIB -D_LARGEFILE64_SOURCE -D_LARGEFILE_SOURCE -I../../mkspecs/linux-g++ -I. -I../../include/QtCore -I../../include -I../../include/QtXml -I.moc/debug-shared -I. -o .obj/debug-shared/qdom.o qdom.cpp
rm -f libQtXml_debug.so.4.0.1 libQtXml_debug.so libQtXml_debug.so.4 libQtXml_debug.so.4.0
g++ -Wl,-rpath,/usr/local/Trolltech/Qt-4.0.1/lib -Wl,-rpath,/usr/local/Trolltech/Qt-4.0.1/lib -shared -Wl,-soname,libQtXml_debug.so.4 -o libQtXml_debug.so.4.0.1 .obj/debug-shared/qxml.o .obj/debug-shared/qdom.o  -L/tmp/qt-x11-opensource-src-4.0.1/lib -lQtCore_debug -lpthread -ldl
ln -s libQtXml_debug.so.4.0.1 libQtXml_debug.so
ln -s libQtXml_debug.so.4.0.1 libQtXml_debug.so.4
ln -s libQtXml_debug.so.4.0.1 libQtXml_debug.so.4.0
rm -f ../../lib/libQtXml_debug.so.4.0.1
rm -f ../../lib/libQtXml_debug.so
rm -f ../../lib/libQtXml_debug.so.4
rm -f ../../lib/libQtXml_debug.so.4.0
mv -f libQtXml_debug.so.4.0.1 libQtXml_debug.so libQtXml_debug.so.4 libQtXml_debug.so.4.0 ../../lib/
make[3]: Leaving directory `/tmp/qt-x11-opensource-src-4.0.1/src/xml'
make -f Makefile.Release all
make[3]: Entering directory `/tmp/qt-x11-opensource-src-4.0.1/src/xml'
g++ -c -pipe -O2 -Wall -W -D_REENTRANT -fPIC -DQT_SHARED -DQT_EDITION=QT_EDITION_DESKTOP -DQT_BUILD_XML_LIB -DQT_NO_CAST_TO_ASCII -DQT3_SUPPORT -DQT_MOC_COMPAT -DQT_NO_DEBUG -DQT_CORE_LIB -D_LARGEFILE64_SOURCE -D_LARGEFILE_SOURCE -I../../mkspecs/linux-g++ -I. -I../../include/QtCore -I../../include -I../../include/QtXml -I.moc/release-shared -I. -o .obj/release-shared/qxml.o qxml.cpp
g++ -c -pipe -O2 -Wall -W -D_REENTRANT -fPIC -DQT_SHARED -DQT_EDITION=QT_EDITION_DESKTOP -DQT_BUILD_XML_LIB -DQT_NO_CAST_TO_ASCII -DQT3_SUPPORT -DQT_MOC_COMPAT -DQT_NO_DEBUG -DQT_CORE_LIB -D_LARGEFILE64_SOURCE -D_LARGEFILE_SOURCE -I../../mkspecs/linux-g++ -I. -I../../include/QtCore -I../../include -I../../include/QtXml -I.moc/release-shared -I. -o .obj/release-shared/qdom.o qdom.cpp
rm -f libQtXml.so.4.0.1 libQtXml.so libQtXml.so.4 libQtXml.so.4.0
g++ -Wl,-rpath,/usr/local/Trolltech/Qt-4.0.1/lib -Wl,-rpath,/usr/local/Trolltech/Qt-4.0.1/lib -shared -Wl,-soname,libQtXml.so.4 -o libQtXml.so.4.0.1 .obj/release-shared/qxml.o .obj/release-shared/qdom.o  -L/tmp/qt-x11-opensource-src-4.0.1/lib -lQtCore -lpthread -ldl
ln -s libQtXml.so.4.0.1 libQtXml.so
ln -s libQtXml.so.4.0.1 libQtXml.so.4
ln -s libQtXml.so.4.0.1 libQtXml.so.4.0
rm -f ../../lib/libQtXml.so.4.0.1
rm -f ../../lib/libQtXml.so
rm -f ../../lib/libQtXml.so.4
rm -f ../../lib/libQtXml.so.4.0
mv -f libQtXml.so.4.0.1 libQtXml.so libQtXml.so.4 libQtXml.so.4.0 ../../lib/
make[3]: Leaving directory `/tmp/qt-x11-opensource-src-4.0.1/src/xml'
make[2]: Leaving directory `/tmp/qt-x11-opensource-src-4.0.1/src/xml'
cd gui && make
make[2]: Entering directory `/tmp/qt-x11-opensource-src-4.0.1/src/gui'
make -f Makefile.Debug all
make[3]: Entering directory `/tmp/qt-x11-opensource-src-4.0.1/src/gui'
/tmp/qt-x11-opensource-src-4.0.1/bin/moc -DQT_SHARED -DQT_EDITION=QT_EDITION_DESKTOP -DQT_BUILD_GUI_LIB -DQT_NO_CAST_TO_ASCII -DQT3_SUPPORT -DQT_MOC_COMPAT -DQT_RASTER_IMAGEENGINE -DQT_NO_STYLE_MAC -DQT_NO_STYLE_WINDOWSXP -DQT_CORE_LIB -D_LARGEFILE64_SOURCE -D_LARGEFILE_SOURCE -I../../mkspecs/linux-g++ -I. -I../../include/QtCore -I../../include -I../../include/QtGui -I../3rdparty/libpng -I../3rdparty/zlib -I/usr/X11R6/include -I.moc/debug-shared -I. kernel/qaction.h -o .moc/debug-shared/moc_qaction.cpp
g++ -c -pipe -g -Wall -W -D_REENTRANT -fPIC -DQT_SHARED -DQT_EDITION=QT_EDITION_DESKTOP -DQT_BUILD_GUI_LIB -DQT_NO_CAST_TO_ASCII -DQT3_SUPPORT -DQT_MOC_COMPAT -DQT_RASTER_IMAGEENGINE -DQT_NO_STYLE_MAC -DQT_NO_STYLE_WINDOWSXP -DQT_CORE_LIB -D_LARGEFILE64_SOURCE -D_LARGEFILE_SOURCE -I../../mkspecs/linux-g++ -I. -I../../include/QtCore -I../../include -I../../include/QtGui -I../3rdparty/libpng -I../3rdparty/zlib -I/usr/X11R6/include -I.moc/debug-shared -I. -o .obj/debug-shared/qaction.o kernel/qaction.cpp
/tmp/qt-x11-opensource-src-4.0.1/bin/moc -DQT_SHARED -DQT_EDITION=QT_EDITION_DESKTOP -DQT_BUILD_GUI_LIB -DQT_NO_CAST_TO_ASCII -DQT3_SUPPORT -DQT_MOC_COMPAT -DQT_RASTER_IMAGEENGINE -DQT_NO_STYLE_MAC -DQT_NO_STYLE_WINDOWSXP -DQT_CORE_LIB -D_LARGEFILE64_SOURCE -D_LARGEFILE_SOURCE -I../../mkspecs/linux-g++ -I. -I../../include/QtCore -I../../include -I../../include/QtGui -I../3rdparty/libpng -I../3rdparty/zlib -I/usr/X11R6/include -I.moc/debug-shared -I. kernel/qactiongroup.h -o .moc/debug-shared/moc_qactiongroup.cpp
g++ -c -pipe -g -Wall -W -D_REENTRANT -fPIC -DQT_SHARED -DQT_EDITION=QT_EDITION_DESKTOP -DQT_BUILD_GUI_LIB -DQT_NO_CAST_TO_ASCII -DQT3_SUPPORT -DQT_MOC_COMPAT -DQT_RASTER_IMAGEENGINE -DQT_NO_STYLE_MAC -DQT_NO_STYLE_WINDOWSXP -DQT_CORE_LIB -D_LARGEFILE64_SOURCE -D_LARGEFILE_SOURCE -I../../mkspecs/linux-g++ -I. -I../../include/QtCore -I../../include -I../../include/QtGui -I../3rdparty/libpng -I../3rdparty/zlib -I/usr/X11R6/include -I.moc/debug-shared -I. -o .obj/debug-shared/qactiongroup.o kernel/qactiongroup.cpp
/tmp/qt-x11-opensource-src-4.0.1/bin/moc -DQT_SHARED -DQT_EDITION=QT_EDITION_DESKTOP -DQT_BUILD_GUI_LIB -DQT_NO_CAST_TO_ASCII -DQT3_SUPPORT -DQT_MOC_COMPAT -DQT_RASTER_IMAGEENGINE -DQT_NO_STYLE_MAC -DQT_NO_STYLE_WINDOWSXP -DQT_CORE_LIB -D_LARGEFILE64_SOURCE -D_LARGEFILE_SOURCE -I../../mkspecs/linux-g++ -I. -I../../include/QtCore -I../../include -I../../include/QtGui -I../3rdparty/libpng -I../3rdparty/zlib -I/usr/X11R6/include -I.moc/debug-shared -I. kernel/qapplication.h -o .moc/debug-shared/moc_qapplication.cpp
g++ -c -pipe -g -Wall -W -D_REENTRANT -fPIC -DQT_SHARED -DQT_EDITION=QT_EDITION_DESKTOP -DQT_BUILD_GUI_LIB -DQT_NO_CAST_TO_ASCII -DQT3_SUPPORT -DQT_MOC_COMPAT -DQT_RASTER_IMAGEENGINE -DQT_NO_STYLE_MAC -DQT_NO_STYLE_WINDOWSXP -DQT_CORE_LIB -D_LARGEFILE64_SOURCE -D_LARGEFILE_SOURCE -I../../mkspecs/linux-g++ -I. -I../../include/QtCore -I../../include -I../../include/QtGui -I../3rdparty/libpng -I../3rdparty/zlib -I/usr/X11R6/include -I.moc/debug-shared -I. -o .obj/debug-shared/qapplication.o kernel/qapplication.cpp
In file included from ../../include/QtGui/private/qt_x11_p.h:1,
                from kernel/qapplication.cpp:51:
../../src/gui/kernel/qt_x11_p.h:50:22: X11/Xlib.h: No such file or directory
../../src/gui/kernel/qt_x11_p.h:55:23: X11/Xutil.h: No such file or directory
../../src/gui/kernel/qt_x11_p.h:56:21: X11/Xos.h: No such file or directory
../../src/gui/kernel/qt_x11_p.h:57:23: X11/Xatom.h: No such file or directory
In file included from ../../include/QtGui/private/qt_x11_p.h:1,
                from kernel/qapplication.cpp:51:
../../src/gui/kernel/qt_x11_p.h:246: error: 'Colormap' is used as a type, but
  is not defined as a type.
../../src/gui/kernel/qt_x11_p.h:247: error: syntax error before `*' token
../../src/gui/kernel/qt_x11_p.h:260: error: `Window' was not declared in this
  scope
../../src/gui/kernel/qt_x11_p.h:260: error: `Atom' was not declared in this
  scope
../../src/gui/kernel/qt_x11_p.h:260: error: parse error before `)' token
../../src/gui/kernel/qt_x11_p.h:260: error: 'Window' is used as a type, but is
  not defined as a type.
../../src/gui/kernel/qt_x11_p.h:263: error: `Window' was not declared in this
  scope
../../src/gui/kernel/qt_x11_p.h:263: error: parse error before `,' token
../../src/gui/kernel/qt_x11_p.h:264: error: `Window' was not declared in this
  scope
../../src/gui/kernel/qt_x11_p.h:264: error: parse error before `,' token
../../src/gui/kernel/qt_x11_p.h:266: error: `Window' was not declared in this
  scope
../../src/gui/kernel/qt_x11_p.h:266: error: parse error before `,' token
../../src/gui/kernel/qt_x11_p.h:277: error: parse error before `*' token
../../src/gui/kernel/qt_x11_p.h:279: error: `Atom' was not declared in this
  scope
../../src/gui/kernel/qt_x11_p.h:279: error: parse error before `)' token
../../src/gui/kernel/qt_x11_p.h:280: error: parse error before `char'
In file included from ../../include/QtGui/private/qt_x11_p.h:1,
                from kernel/qapplication.cpp:51:
../../src/gui/kernel/qt_x11_p.h:328: error: syntax error before `*' token
../../src/gui/kernel/qt_x11_p.h:330: error: syntax error before `*' token
../../src/gui/kernel/qt_x11_p.h:332: error: 'Window' is used as a type, but is
  not defined as a type.
../../src/gui/kernel/qt_x11_p.h:338: error: 'Time' is used as a type, but is
  not defined as a type.
../../src/gui/kernel/qt_x11_p.h:339: error: 'Time' is used as a type, but is
  not defined as a type.
../../src/gui/kernel/qt_x11_p.h:365: error: syntax error before `*' token
../../src/gui/kernel/qt_x11_p.h:366: error: 'Colormap' is used as a type, but
  is not defined as a type.
../../src/gui/kernel/qt_x11_p.h:511: error: parse error before `[' token
../../src/gui/kernel/qt_x11_p.h:521: error: `FocusOut' was not declared in this
  scope
../../src/gui/kernel/qt_x11_p.h:521: error: enumerator value for `XFocusOut'
  not integer constant
../../src/gui/kernel/qt_x11_p.h:522: error: `FocusIn' was not declared in this
  scope
../../src/gui/kernel/qt_x11_p.h:522: error: enumerator value for `XFocusIn' not
  integer constant
../../src/gui/kernel/qt_x11_p.h:523: error: `KeyPress' was not declared in this
  scope
../../src/gui/kernel/qt_x11_p.h:523: error: enumerator value for `XKeyPress'
  not integer constant
../../src/gui/kernel/qt_x11_p.h:524: error: `KeyRelease' was not declared in
  this scope
../../src/gui/kernel/qt_x11_p.h:524: error: enumerator value for `XKeyRelease'
  not integer constant
../../src/gui/kernel/qt_x11_p.h:525: error: `None' was not declared in this
  scope
../../src/gui/kernel/qt_x11_p.h:525: error: enumerator value for `XNone' not
  integer constant
../../src/gui/kernel/qt_x11_p.h:526: error: `RevertToParent' was not declared
  in this scope
../../src/gui/kernel/qt_x11_p.h:526: error: enumerator value for `
  XRevertToParent' not integer constant
../../src/gui/kernel/qt_x11_p.h:527: error: `GrayScale' was not declared in
  this scope
../../src/gui/kernel/qt_x11_p.h:527: error: enumerator value for `XGrayScale'
  not integer constant
../../src/gui/kernel/qt_x11_p.h:529: error: `CursorShape' was not declared in
  this scope
../../src/gui/kernel/qt_x11_p.h:529: error: enumerator value for `XCursorShape'
  not integer constant
../../src/gui/kernel/qt_x11_p.h:543: error: `XPoint' was not declared in this
  scope
../../src/gui/kernel/qt_x11_p.h:543: error: template argument 1 is invalid
../../src/gui/kernel/qt_x11_p.h:543: error: `XPoint' was not declared in this
  scope
../../src/gui/kernel/qt_x11_p.h:543: error: enumerator value for `isLarge' not
  integer constant
../../src/gui/kernel/qt_x11_p.h:543: error: can't make `name' into a method --
  not in a class
../../src/gui/kernel/qt_x11_p.h:544: error: `XRectangle' was not declared in
  this scope
../../src/gui/kernel/qt_x11_p.h:544: error: template argument 1 is invalid
../../src/gui/kernel/qt_x11_p.h:544: error: `XRectangle' was not declared in
  this scope
../../src/gui/kernel/qt_x11_p.h:544: error: enumerator value for `isLarge' not
  integer constant
../../src/gui/kernel/qt_x11_p.h:544: error: can't make `name' into a method --
  not in a class
../../src/gui/kernel/qt_x11_p.h:545: error: `XChar2b' was not declared in this
  scope
../../src/gui/kernel/qt_x11_p.h:545: error: template argument 1 is invalid
../../src/gui/kernel/qt_x11_p.h:545: error: `XChar2b' was not declared in this
  scope
../../src/gui/kernel/qt_x11_p.h:545: error: enumerator value for `isLarge' not
  integer constant
../../src/gui/kernel/qt_x11_p.h:545: error: can't make `name' into a method --
  not in a class
make[3]: *** [.obj/debug-shared/qapplication.o] Error 1
make[3]: Leaving directory `/tmp/qt-x11-opensource-src-4.0.1/src/gui'
make[2]: *** [debug-all] Error 2
make[2]: Leaving directory `/tmp/qt-x11-opensource-src-4.0.1/src/gui'
make[1]: *** [sub-gui-make_default-ordered] Error 2
make[1]: Leaving directory `/tmp/qt-x11-opensource-src-4.0.1/src'
make: *** [sub-src-make_default-ordered] Error 2
root@ubuntu:/tmp/qt-x11-opensource-src-4.0.1 #


yogeshm02 09-10-2005 10:09 AM

Please specify your problem clearly. Firsr, you were saying that you have qt4 installed but you could not get your program compiled. Now, in you latest post you said that

"I just tried to install qt4.0.1 again. I got these same errors as before from the make command. Here are some of them:"
meaning you had not qt4 installed earlier.


You do not need any entry in .bashrc to compile qt4 (And you have correct version) just create a new copy of qt4 source and recompile it as instructed in "readme" and "install" files shipped with qt4.

fakie_flip 09-10-2005 10:19 AM

What I mean is that I tried to install it. I have the qt files in /usr/local/Trolltech/Qt-4.0.1/, but I do not know if they are all there. qmake does not work. I also get errors from su -c "make install". I just downloaded qt4 again and tried to install it again. The same thing happened as before. Do you really think I should find source and try again after what I just did?

yogeshm02 09-10-2005 10:42 AM

If you are having errors while su -c 'make install' then qt4 is not installed properly on your system. You need to install it properly. Try the following: -

If you have tallied md5 checksum then again give it a try; unpack the archieve in a fresh directory and again compile and install qt. If you still get errors, then, you may have to contact qt for help.

fakie_flip 09-14-2005 09:04 PM

Thats obvious qt is not installed properly. Repeating the same thing over and over is not going to help. What is the syntax for the APT line in Synaptic? Wiki does not explain it well. Wiki just shows some examples but does not tell what any of it means. I am trying to add (ftp://ftp.us.debian.org/). It is not as easy as just going in, looking for repositories in the menus and adding it. That is obvious. I tried it. I know why qt will not install now, and I wanted to use that repository above to get it. Thanks.


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