Announcement

Collapse
No announcement yet.

qt4 help

Collapse
This topic is closed.
X
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    qt4 help

    I just installed trolltech Qt4 for X11 and I'm having som problems from the start.
    When trying to compile my litle helloworld program as shown in the toturial the 'make' program returns an error message
    Code:
    g++ -c -pipe -Wall -W -O2 -D_REENTRANT -DQT_NO_DEBUG -DQT_THREAD_SUPPORT -DQT_SHARED -DQT_TABLET_SUPPORT -I/usr/share/qt3/mkspecs/default -I. -I. -I/usr/include/qt3 -o hello.o hello.cpp
    hello.cpp:1:28: error: QApplication: No such file or directory
    hello.cpp:2:27: error: QPushButton: No such file or directory
    line 1&2 is
    #include <QApplication>
    #include <QPushButton>
    this is after I have succsessfully ran: qmake -project & qmake

    I'm wondering if I've missed something during the installation.
    I've put the PATH thing in /root/.profile (is that the right place?)

    I haven't found somewhere to type my codes yet either, I'm using kate now. I have found the form Designer and the Assistant but not a code editor.

    If someone here can help me out I would be a much happier guy.

    #2
    Re: qt4 help

    How about?

    #include <QApplication.h>
    #include <QPushButton.h>

    ~ Patrick

    Comment


      #3
      Re: qt4 help

      Patrick, I don't think that's the problem. QT4 supports that kind of #includes. The problem is that he is trying to compile qt4 example with qt3 toolkit (see his code part).

      @Djem
      You must modify your makefile to use QT4 includes for this to work.

      Cheers,

      Comment


        #4
        Re: qt4 help

        I see... That makes sense.
        Just one more thing, how do I do that?
        Maybe I should try QT3 instead, I just wan't to try it out, I'm not a programmer or anything (only used Visual Basic)

        Thanks for the help.

        Comment


          #5
          Re: qt4 help

          Sorry for late answer...

          Make an empty txt file and name it, for example, 'project.pro'. Make it look something like this :
          Code:
          CONFIG += qt
          HEADERS += hello.h
          SOURCES += hello.cpp
          SOURCES += main.cpp
          Offcourse, you should know that this may not work depending on your specific example. Make sure to put all headers and sources used like in example above.

          Place all your source files in the same directory and run
          Code:
          qmake -o Makefile project.pro
          This should create the makefile, so to compile it you just run 'make'.

          Also make sure that 'qmake' is QT4 ! On my Kubuntu system this should be
          Code:
          qmake-qt4 -o Makefile project.pro

          Comment


            #6
            Re: qt4 help

            Hei
            I have also installed qt-4.
            In /etc/alternatives you will find qmake, moc, and other programs relevant for qt-4. These are links to programs in /usr/bin. qmake in /etc/alternatives links to
            qmake-qt3 in /usr/bin. You have to link it to qmake-qt4. And look for other programs that ends with -qt3 or qt4 and change the links

            rasputin

            Comment

            Working...
            X