wie kann ich qt 4 auf linux benutzen



  • als erstes hab ich mit die evalu. von trolltech geladen und gebaut aber nicht mit make install installiert.
    dann habe ich mir die daten nach usr/local/trolltech verschoben und in die bashrc folgende eingetragen:

    export QTDIR="/usr/local/Trolltech/Qt-4.0.1"
    export PATH="/usr/local/Trolltech/Qt-4.0.1/bin:$PATH"
    export LD_LIBRARY_PATH="/usr/local/Trolltech/Qt-4.0.1/lib:$LD_LIBRARY_PATH"
    export LIBRARY_PATH="/usr/local/Trolltech/Qt-4.0.1/lib:$LIBRARY_PATH"
    

    dann funktioniert auch das starten von designer in der neuen version pproblemlos...
    ABER als ich mal folgendes ausprobieren wollte:

    #include <QtGui/QApplication>
    #include <QtGui/QPushButton>
    #include <QtGui/QLabel>
    #include <QtGui/QFont>
    
    int main(int argc, char *argv[])
    {
        QApplication app(argc, argv);
    
        QWidget window;
        window.resize(200, 100);
    
        QLabel label("Hello World!", &window);
        label.setGeometry(0, 0, 200, 50);
        label.setAlignment(Qt::AlignCenter);
        label.setFont(QFont("Arial", 20, QFont::Bold));
    
        QPushButton button("Close", &window);
        button.setGeometry(10, 60, 180, 30);
        QObject::connect(&button, SIGNAL(clicked()), &window, SLOT(close()));
    
        window.show();
    
        return app.exec();
    }
    

    bekom ich immer folgendes:

    ...
    
    g++ -c -pipe -g -Wall -W -D_REENTRANT -DQT_CORE_LIB -DQT_GUI_LIB -DQT_SHARED -I/
    usr/local/Trolltech/Qt-4.0.1/mkspecs/linux-g++ -I. -I/usr/local/Trolltech/Qt-4.0
    .1/include/QtGui -I/usr/local/Trolltech/Qt-4.0.1/include/QtCore -I/usr/local/Tro
    lltech/Qt-4.0.1/include -I. -I. -o main.o main.cpp
    In file included from /usr/local/Trolltech/Qt-4.0.1/include/QtCore/qglobal.h:1,
                     from /usr/local/Trolltech/Qt-4.0.1/include/QtCore/../../src/cor
    elib/global/qnamespace.h:27,
                     from /usr/local/Trolltech/Qt-4.0.1/include/QtCore/qnamespace.h:
    1,
                     from /usr/local/Trolltech/Qt-4.0.1/include/QtCore/../../src/cor
    elib/kernel/qobjectdefs.h:27,
                     from /usr/local/Trolltech/Qt-4.0.1/include/QtCore/qobjectdefs.h
    :1,
                     from /usr/local/Trolltech/Qt-4.0.1/include/QtCore/../../src/cor
    elib/kernel/qobject.h:29,
                     from /usr/local/Trolltech/Qt-4.0.1/include/QtCore/qobject.h:1,
                     from /usr/local/Trolltech/Qt-4.0.1/include/QtCore/../../src/cor
    elib/kernel/qcoreapplication.h:27,
                     from /usr/local/Trolltech/Qt-4.0.1/include/QtCore/qcoreapplicat
    ion.h:1,
                     from /usr/local/Trolltech/Qt-4.0.1/include/QtGui/../../src/gui/
    kernel/qapplication.h:27,
                     from /usr/local/Trolltech/Qt-4.0.1/include/QtGui/qapplication.h
    :1,
                     from /usr/local/Trolltech/Qt-4.0.1/include/QtGui/QApplication:1
    ,
                     from main.cpp:1:
    /usr/local/Trolltech/Qt-4.0.1/include/QtCore/../../src/corelib/global/qglobal.h:
    40:28: error: QtCore/qconfig.h: Datei oder Verzeichnis nicht gefunden
    /usr/local/Trolltech/Qt-4.0.1/include/QtCore/../../src/corelib/global/qglobal.h:
    934:6: error: #error "Qt not configured correctly, please run configure"
    /usr/local/Trolltech/Qt-4.0.1/include/QtCore/../../src/corelib/global/qglobal.h:
    1650:6: error: #error "Qt not configured correctly, please run configure"
    In file included from /usr/local/Trolltech/Qt-4.0.1/include/QtCore/qatomic.h:1,
                     from /usr/local/Trolltech/Qt-4.0.1/include/QtCore/../../src/cor
    elib/tools/qbytearray.h:28,
                     from /usr/local/Trolltech/Qt-4.0.1/include/QtCore/qbytearray.h:
    1,
                     from /usr/local/Trolltech/Qt-4.0.1/include/QtCore/../../src/cor
    elib/tools/qstring.h:28,
                     from /usr/local/Trolltech/Qt-4.0.1/include/QtCore/qstring.h:1,
                     from /usr/local/Trolltech/Qt-4.0.1/include/QtCore/../../src/cor
    elib/kernel/qobject.h:31,
                     from /usr/local/Trolltech/Qt-4.0.1/include/QtCore/qobject.h:1,
                     from /usr/local/Trolltech/Qt-4.0.1/include/QtCore/../../src/cor
    elib/kernel/qcoreapplication.h:27,
                     from /usr/local/Trolltech/Qt-4.0.1/include/QtCore/qcoreapplicat
    ion.h:1,
                     from /usr/local/Trolltech/Qt-4.0.1/include/QtGui/../../src/gui/
    kernel/qapplication.h:27,
                     from /usr/local/Trolltech/Qt-4.0.1/include/QtGui/qapplication.h
    :1,
                     from /usr/local/Trolltech/Qt-4.0.1/include/QtGui/QApplication:1
    ,
                     from main.cpp:1:
    /usr/local/Trolltech/Qt-4.0.1/include/QtCore/../../src/corelib/thread/qatomic.h:
    31:35: error: QtCore/arch/qatomic.h: Datei oder Verzeichnis nicht gefunden
    main.cpp:25:2: warning: no newline at end of file
    /usr/local/Trolltech/Qt-4.0.1/include/QtCore/../../src/corelib/global/qnamespace
    .h:29: error: ‘QtValidLicenseForCoreModule’ does not name a type
    /usr/local/Trolltech/Qt-4.0.1/include/QtCore/../../src/corelib/kernel/qobjectdef
    s.h:29: error: ‘QtValidLicenseForCoreModule’ does not name a type
    /usr/local/Trolltech/Qt-4.0.1/include/QtCore/../../src/corelib/tools/qchar.h:29:
     error: ‘QtValidLicenseForCoreModule’ does not name a type
    /usr/local/Trolltech/Qt-4.0.1/include/QtCore/../../src/corelib/thread/qatomic.h:
    35: error: ‘QtValidLicenseForCoreModule’ does not name a type
    /usr/local/Trolltech/Qt-4.0.1/include/QtCore/../../src/corelib/thread/qatomic.h:
     In member function ‘bool QBasicAtomic::ref()’:
    /usr/local/Trolltech/Qt-4.0.1/include/QtCore/../../src/corelib/thread/qatomic.h:
    67: error: ‘q_atomic_increment’ was not declared in this scope
    /usr/local/Trolltech/Qt-4.0.1/include/QtCore/../../src/corelib/thread/qatomic.h:
     In member function ‘bool QBasicAtomic::deref()’:
    /usr/local/Trolltech/Qt-4.0.1/include/QtCore/../../src/corelib/thread/qatomic.h:
    70: error: ‘q_atomic_decrement’ was not declared in this scope
    /usr/local/Trolltech/Qt-4.0.1/include/QtCore/../../src/corelib/thread/qatomic.h:                                                        In member function ‘QBasicAtomic& QBasicAtomic::operator=(int)’:
    /usr/local/Trolltech/Qt-4.0.1/include/QtCore/../../src/corelib/thread/qatomic.h:                                                       86: error: ‘q_atomic_set_int’ was not declared in this scope
    /usr/local/Trolltech/Qt-4.0.1/include/QtCore/../../src/corelib/thread/qatomic.h:                                                        In member function ‘bool QBasicAtomic::testAndSet(int, int)’:
    /usr/local/Trolltech/Qt-4.0.1/include/QtCore/../../src/corelib/thread/qatomic.h:                                                       91: error: ‘q_atomic_test_and_set_int’ was not declared in this scope
    /usr/local/Trolltech/Qt-4.0.1/include/QtCore/../../src/corelib/thread/qatomic.h:                                                        In member function ‘int QBasicAtomic::exchange(int)’:
    /usr/local/Trolltech/Qt-4.0.1/include/QtCore/../../src/corelib/thread/qatomic.h:                                                       94: error: ‘q_atomic_set_int’ was not declared in this scope
    /usr/local/Trolltech/Qt-4.0.1/include/QtCore/../../src/corelib/tools/qbytearray.                                                       h: At global scope:
    /usr/local/Trolltech/Qt-4.0.1/include/QtCore/../../src/corelib/tools/qbytearray.                                                       h:38: error: ‘QtValidLicenseForCoreModule’ does not name a type
    /usr/local/Trolltech/Qt-4.0.1/include/QtCore/../../src/corelib/tools/qstring.h:6                                                       1: error: ‘QtValidLicenseForCoreModule’ does not name a type
    /usr/local/Trolltech/Qt-4.0.1/include/QtCore/../../src/corelib/tools/qiterator.h                                                       :29: error: ‘QtValidLicenseForCoreModule’ does not name a type
    /usr/local/Trolltech/Qt-4.0.1/include/QtCore/../../src/corelib/tools/qalgorithms                                                       .h:29: error: ‘QtValidLicenseForCoreModule’ does not name a type
    /usr/local/Trolltech/Qt-4.0.1/include/QtCore/../../src/corelib/tools/qlist.h:36: error: ‘QtValidLicenseForCoreModule’ does not name a type
    /usr/local/Trolltech/Qt-4.0.1/include/QtCore/../../src/corelib/kernel/qobject.h:39: error: ‘QtValidLicenseForCoreModule’ does not name a type
    /usr/local/Trolltech/Qt-4.0.1/include/QtCore/../../src/corelib/kernel/qcoreevent.h:29: error: ‘QtValidLicenseForCoreModule’ does not name a type
    /usr/local/Trolltech/Qt-4.0.1/include/QtCore/../../src/corelib/kernel/qeventloop.h:29: error: ‘QtValidLicenseForCoreModule’ does not name a type
    /usr/local/Trolltech/Qt-4.0.1/include/QtCore/../../src/corelib/kernel/qcoreapplication.h:35: error: ‘QtValidLicenseForCoreModule’ does not name a type
    /usr/local/Trolltech/Qt-4.0.1/include/QtGui/../../src/gui/kernel/qwindowdefs.h:30: error: ‘QtValidLicenseForGuiModule’ does not name a type
    /usr/local/Trolltech/Qt-4.0.1/include/QtCore/../../src/corelib/tools/qpoint.h:29: error: ‘QtValidLicenseForCoreModule’ does not name a type
    /usr/local/Trolltech/Qt-4.0.1/include/QtCore/../../src/corelib/tools/qsize.h:29: error: ‘QtValidLicenseForCoreModule’ does not name a type
    /usr/local/Trolltech/Qt-4.0.1/include/QtGui/../../src/gui/kernel/qcursor.h:31: error: ‘QtValidLicenseForGuiModule’ does not name a type
    /usr/local/Trolltech/Qt-4.0.1/include/QtGui/../../src/gui/kernel/qapplication.h:43: error: ‘QtValidLicenseForGuiModule’ does not name a type
    /usr/local/Trolltech/Qt-4.0.1/include/QtCore/../../src/corelib/tools/qrect.h:34: error: ‘QtValidLicenseForCoreModule’ does not name a type
    /usr/local/Trolltech/Qt-4.0.1/include/QtGui/../../src/gui/painting/qpaintdevice.h:30: error: ‘QtValidLicenseForGuiModule’ does not name a type
    /usr/local/Trolltech/Qt-4.0.1/include/QtCore/../../src/corelib/io/qiodevice.h:38: error: ‘QtValidLicenseForCoreModule’ does not name a type
    /usr/local/Trolltech/Qt-4.0.1/include/QtCore/../../src/corelib/io/qdatastream.h:30: error: ‘QtValidLicenseForCoreModule’ does not name a type
    /usr/local/Trolltech/Qt-4.0.1/include/QtCore/../../src/corelib/tools/qregexp.h:31: error: ‘QtValidLicenseForCoreModule’ does not name a type
    /usr/local/Trolltech/Qt-4.0.1/include/QtCore/../../src/corelib/tools/qstringmatcher.h:29: error: ‘QtValidLicenseForCoreModule’ does not name a type
    /usr/local/Trolltech/Qt-4.0.1/include/QtCore/../../src/corelib/tools/qstringlist.h:38: error: ‘QtValidLicenseForCoreModule’ does not name a type
    /usr/local/Trolltech/Qt-4.0.1/include/QtGui/../../src/gui/painting/qrgb.h:29: error: ‘QtValidLicenseForGuiModule’ does not name a type
    /usr/local/Trolltech/Qt-4.0.1/include/QtGui/../../src/gui/painting/qcolor.h:31: error: ‘QtValidLicenseForGuiModule’ does not name a type
    /usr/local/Trolltech/Qt-4.0.1/include/QtGui/../../src/gui/image/qimage.h:32: error: ‘QtValidLicenseForGuiModule’ does not name a type
    /usr/local/Trolltech/Qt-4.0.1/include/QtGui/../../src/gui/image/qpixmap.h:33: error: ‘QtValidLicenseForGuiModule’ does not name a type
    /usr/local/Trolltech/Qt-4.0.1/include/QtGui/../../src/gui/image/qicon.h:31: error: ‘QtValidLicenseForGuiModule’ does not name a type
    /usr/local/Trolltech/Qt-4.0.1/include/QtGui/../../src/gui/kernel/qkeysequence.h:30: error: ‘QtValidLicenseForGuiModule’ does not name a type
    /usr/local/Trolltech/Qt-4.0.1/include/QtCore/../../src/corelib/tools/qpair.h:29: error: ‘QtValidLicenseForCoreModule’ does not name a type
    /usr/local/Trolltech/Qt-4.0.1/include/QtCore/../../src/corelib/tools/qvector.h:38: error: ‘QtValidLicenseForCoreModule’ does not name a type
    /usr/local/Trolltech/Qt-4.0.1/include/QtGui/../../src/gui/painting/qbrush.h:32: error: ‘QtValidLicenseForGuiModule’ does not name a type
    /usr/local/Trolltech/Qt-4.0.1/include/QtGui/../../src/gui/kernel/qpalette.h:31: error: ‘QtValidLicenseForGuiModule’ does not name a type
    /usr/local/Trolltech/Qt-4.0.1/include/QtGui/../../src/gui/text/qfont.h:30: error: ‘QtValidLicenseForGuiModule’ does not name a type
    /usr/local/Trolltech/Qt-4.0.1/include/QtGui/../../src/gui/text/qfontmetrics.h:32: error: ‘QtValidLicenseForGuiModule’ does not name a type
    /usr/local/Trolltech/Qt-4.0.1/include/QtGui/../../src/gui/text/qfontinfo.h:29: error: ‘QtValidLicenseForGuiModule’ does not name a type
    /usr/local/Trolltech/Qt-4.0.1/include/QtGui/../../src/gui/kernel/qsizepolicy.h:30: error: ‘QtValidLicenseForGuiModule’ does not name a type
    /usr/local/Trolltech/Qt-4.0.1/include/QtGui/../../src/gui/painting/qregion.h:31: error: ‘QtValidLicenseForGuiModule’ does not name a type
    /usr/local/Trolltech/Qt-4.0.1/include/QtGui/../../src/gui/kernel/qwidget.h:44: error: ‘QtValidLicenseForGuiModule’ does not name a type
    /usr/local/Trolltech/Qt-4.0.1/include/QtGui/../../src/gui/widgets/qabstractbutton.h:31: error: ‘QtValidLicenseForGuiModule’ does not name a type
    /usr/local/Trolltech/Qt-4.0.1/include/QtGui/../../src/gui/widgets/qpushbutton.h:29: error: ‘QtValidLicenseForGuiModule’ does not name a type
    /usr/local/Trolltech/Qt-4.0.1/include/QtGui/../../src/gui/widgets/qframe.h:29: error: ‘QtValidLicenseForGuiModule’ does not name a type
    /usr/local/Trolltech/Qt-4.0.1/include/QtGui/../../src/gui/widgets/qlabel.h:29: error: ‘QtValidLicenseForGuiModule’ does not name a type
    /usr/local/Trolltech/Qt-4.0.1/include/QtCore/../../src/corelib/thread/qatomic.h: In function ‘T qAtomicSetPtr(volatile T*, T) [with T = QListData::Data*]’:
    /usr/local/Trolltech/Qt-4.0.1/include/QtCore/../../src/corelib/tools/qlist.h:499:   instantiated from ‘QList<T>::~QList() [with T = QString]’
    /usr/local/Trolltech/Qt-4.0.1/include/QtCore/../../src/corelib/tools/qstringlist.h:48:   instantiated from here
    /usr/local/Trolltech/Qt-4.0.1/include/QtCore/../../src/corelib/thread/qatomic.h:139: error: ‘q_atomic_set_ptr’ was not declared in this scope
    make: *** [main.o] Fehler 1
    

    nun wollt ich wissen woran das kliegt, ich wollte endlich mal richtig mit Qt 4 durchstarten, aber es will halt nicht so richtig!



  • Kurze Zwischenfrage:
    Warum hast du es denn nicht mit 'make install' installiert? Kann man das denn einfach so machen wie du? Was hat das fuer Vorteile?



  • #include <QtGui> !!!!!!!!!!!!!!!!1



  • Hast du als -prefix beim Konfigurieren deinen QTDIR angegeben?

    Die Versionen vor 4.0 konnte man ganz gut ohne Installation aus dem kompilierten Verzeichnis benutzen. Ab 4.0 installiere ich Qt lieber, aber auch in eine separates Verzeichnis.



  • nein habe ich nicht! ./configure, dann make ,etc...
    dann zur frage was das fürn vorteil hat... ich kann linux bzw. und vorallem kde noch benutzen, sowie anwendungen für kde bauen.

    wie würdet ihr qt installieren, und zwar schön sauber?
    PONTO erklär bitte 🙄



  • dgrat schrieb:

    nein habe ich nicht! ./configure, dann make ,etc...
    dann zur frage was das fürn vorteil hat... ich kann linux bzw. und vorallem kde noch benutzen, sowie anwendungen für kde bauen.

    wie würdet ihr qt installieren, und zwar schön sauber?
    PONTO erklär bitte 🙄

    Ich würde es mal so versuchen:

    export QTDIR="/usr/local/Trolltech/Qt-4.1.0"
    export PATH="${QTDIR}/bin:$PATH"
    export LD_LIBRARY_PATH="${QTDIR}/lib:$LD_LIBRARY_PATH"
    
    ./configure -prefix ${QTDIR} -qt-gif
    make
    make install
    

    Wenn du dann noch ein Problem hast, kannst du erneut fragen.

    Zwei wichtige Änderungen:

    1. Nimm Qt 4.1
    2. Vergiss LIBRARY_PATH.



  • weiß einer warum ich das bekomme

    g++ -c -pipe -g -fvisibility=hidden -fvisibility-inlines-hidden -Wall -W -D_REEN                                                       TRANT -fPIC -DQT_SHARED -DQT_EDITION=QT_EDITION_DESKTOP -DQT_BUILD_COMPAT_LIB -D                                                       QT_NO_CAST_TO_ASCII -DQT3_SUPPORT -DQT_MOC_COMPAT -DQT3_SUPPORT -DQT_SQL_LIB -DQ                                                       T_XML_LIB -DQT_GUI_LIB -DQT_NETWORK_LIB -DQT_CORE_LIB -D_LARGEFILE64_SOURCE -D_L                                                       ARGEFILE_SOURCE -I../../mkspecs/linux-g++ -I. -I../../include/QtCore -I../../inc                                                       lude/QtNetwork -I../../include/QtGui -I../../include/QtXml -I../../include/QtSql                                                        -I../../include -I../../include/Qt3Support -I.moc/debug-shared -I. -o .obj/debu                                                       g-shared/q3dns.o network/q3dns.cpp
    In file included from /usr/include/linux/param.h:4,
                     from /usr/include/sys/param.h:24,
                     from /usr/include/arpa/nameser.h:56,
                     from network/q3dns.cpp:31:
    /usr/include/asm/param.h:1:26: error: linux/config.h: Datei oder Verzeichnis nic                                                       ht gefunden
    make[3]: *** [.obj/debug-shared/q3dns.o] Fehler 1
    make[3]: Leaving directory `/root/qt-x11-opensource-src-4.1.0/src/qt3support'
    make[2]: *** [debug-all] Fehler 2
    make[2]: Leaving directory `/root/qt-x11-opensource-src-4.1.0/src/qt3support'
    make[1]: *** [sub-qt3support-make_default-ordered] Fehler 2
    make[1]: Leaving directory `/root/qt-x11-opensource-src-4.1.0/src'
    make: *** [sub-src-make_default-ordered] Fehler 2
    

    😞



  • dgrat schrieb:

    weiß einer warum ich das bekomme

    g++ -c -pipe -g -fvisibility=hidden -fvisibility-inlines-hidden -Wall -W -D_REEN                                                       TRANT -fPIC -DQT_SHARED -DQT_EDITION=QT_EDITION_DESKTOP -DQT_BUILD_COMPAT_LIB -D                                                       QT_NO_CAST_TO_ASCII -DQT3_SUPPORT -DQT_MOC_COMPAT -DQT3_SUPPORT -DQT_SQL_LIB -DQ                                                       T_XML_LIB -DQT_GUI_LIB -DQT_NETWORK_LIB -DQT_CORE_LIB -D_LARGEFILE64_SOURCE -D_L                                                       ARGEFILE_SOURCE -I../../mkspecs/linux-g++ -I. -I../../include/QtCore -I../../inc                                                       lude/QtNetwork -I../../include/QtGui -I../../include/QtXml -I../../include/QtSql                                                        -I../../include -I../../include/Qt3Support -I.moc/debug-shared -I. -o .obj/debu                                                       g-shared/q3dns.o network/q3dns.cpp
    In file included from /usr/include/linux/param.h:4,
                     from /usr/include/sys/param.h:24,
                     from /usr/include/arpa/nameser.h:56,
                     from network/q3dns.cpp:31:
    /usr/include/asm/param.h:1:26: error: linux/config.h: Datei oder Verzeichnis nic                                                       ht gefunden
    make[3]: *** [.obj/debug-shared/q3dns.o] Fehler 1
    make[3]: Leaving directory `/root/qt-x11-opensource-src-4.1.0/src/qt3support'
    make[2]: *** [debug-all] Fehler 2
    make[2]: Leaving directory `/root/qt-x11-opensource-src-4.1.0/src/qt3support'
    make[1]: *** [sub-qt3support-make_default-ordered] Fehler 2
    make[1]: Leaving directory `/root/qt-x11-opensource-src-4.1.0/src'
    make: *** [sub-src-make_default-ordered] Fehler 2
    

    😞

    Fehlen dir die Kernel Devel Pakete?

    Unter Suse ist die fehlende Datei im Paket glibc-kernheaders drin.



  • in der param.h steht:
    #include <linux/config.h>
    config.h ist aber in
    /usr/src/linux-2.6.13-15.7/include/linux

    und dort scheint er scheint er sie nicht zu finden... , wenn ich parm.h umschreibe und config.h in das selbe verzeichnis verschiebe wie parm.h, meckert wiederum config.h darüber dass es autoconf.h nicht finden kann... die liegt übrigens auch in
    /usr/src/linux-2.6.13-15.7/include/linux

    ziemlich merkwürdig zumal ich schon kerneldateien umschreiben musste um das scheißding zzu bauen 😡
    suse 10 ist doof



  • ich hab jetzt die ganze datei neu geschrieben, ich meld mich wenn qt fertig ist



  • Die gesuchte Datei ist /usr/include/linux/config.h.

    Auf Suse 9.3 ist sie im von mir genannten Paket. In Suse 10.0 ist sie im Paket glibc-devel. Ist das installiert?



  • ja war installiert! aber die wurde nicht gefunden... deshalb hab ich die dateien die die entsprechenden dateien brauchen im #includeteil umgeschrieben oder im falle von sinnlosen headerdateien einfach auskommentiert...
    betraf nur die autoconfig.h die von der sinnlosen config.h lediglich aufgerufen wurde...
    schlussendlich funktioniert nun mein Qt... ich habe es so gebaut wie du gesagt hast. und mein Beispiel compilliert jetzt auch DANKE DANKE! ponto 👍


Anmelden zum Antworten