qt4 met borland 5 builder

Pagina: 1
Acties:

  • Duim
  • Registratie: December 2001
  • Laatst online: 22-04 10:47

Duim

Thumbs up!

Topicstarter
Ik ben mijn eerste stapjes met qt4 aan het zetten, maar krijg het niet aan de praat met Borland 5 builder. Ik heb borland best aan de gang gekregen eerder met 'gewoon c++' voor in de shell, maar het lijkt alsof borland de qt4 include directory niet kan vinden of zo (terwijl ik die toch echt wel heb aangegeven).


Nu heb ik het vermoeden vanwege een enkel artikel over borland en qt op het internet dat ik niet 'zomaar' even wat qt code in borland kan compilen, maar hoe moet dit dan wel? Een tweede vraag die hier waarschijnlijk mee te maken heeft: wat doet qmake? Ik heb nooit makefiles gebruikt. Ikniesnapnie.

Ik probeer de hello.cpp, main.cpp, hello.h uit:


main.cpp:
C++:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
#include <qapplication.h>
#include "hello.h"

int main(int argc, char **argv)
{
    QApplication a(argc, argv);

    MyPushButton* hello = new MyPushButton("Hello world!");
    hello->resize(100, 30);

    a.setMainWidget(hello);
    hello->show();
    return a.exec();
}


hello.cpp:
C++:
1
2
3
4
5
6
7
#include "hello.h"

MyPushButton::MyPushButton(const QString& text)
    : QPushButton(text, 0, "mypushbutton")
{
    qDebug("My PushButton has been constructed");
}


hello.h
C++:
1
2
3
4
5
6
7
#include <qpushbutton.h>

class MyPushButton : public QPushButton
{
public:
    MyPushButton(const QString&);
};


Foutmeldingen:
[C++ Error] HELLO.H(1): E2209 Unable to open include file 'qpushbutton.h'
[C++ Error] HELLO.H(4): E2303 Type name expected
[C++ Error] HELLO.H(6): E2293 ) expected
[C++ Error] HELLO.H(7): E2040 Declaration terminated incorrectly
[C++ Error] HELLO.H(7): E2190 Unexpected }
[C++ Error] HELLO.H(7): E2190 Unexpected }
[C++ Error] hello.cpp(3): E2293 ) expected

  • writser
  • Registratie: Mei 2000
  • Laatst online: 16-04 20:35
Check de officiele Qt4 tutorial. Let met name op de header die ze includen!

http://doc.trolltech.com/4.0/tutorial-t1.html

Onvoorstelbaar!