Seite 1 von 1

Probleme mit Kompilieren

Verfasst: 1. März 2005 16:22
von delay
Hallo

hab aus der Schule ne "QT 3.2.2 Educational Version". Eigentlich benutze ich den Borland Compiler für C++. So weit so gut.

Habe QT Ordnungsgemäss installiert und dann die verschiedennen Pfade gesetzt/überprüfft:

PATH: C:\Qt\3.2.2Educational\bin
QMAKESPEC: C:\Qt\3.2.2Educational\mkspecs\win32-borland
QTDIR: C:\Qt\3.2.2Educational\

wenn ich aber dann ein einfaches Programm wie dieses hier:

Code: Alles auswählen

#include <qapplication.h>
#include <qpushbutton.h>


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

    QPushButton hello( "Hello world!", 0 );
    hello.resize( 100, 30 );

    a.setMainWidget( &hello );
    hello.show();
    return a.exec();
}
compilieren möchte, bekomme ich folgende Fehlermeldungen

Code: Alles auswählen


C:\Dokumente und Einstellungen\itanic\Desktop>z:

Z:\>cd CPP

Z:\CPP>cd schule

Z:\CPP\schule>cd qttest1

Z:\CPP\schule\QtTest1>bcc32 qttest1.cpp
Borland C++ 5.6 for Win32 Copyright (c) 1993, 2002 Borland
QtTest1.cpp:
Error E2209 QtTest1.cpp 1: Unable to open include file 'qapplication.h'
Error E2209 QtTest1.cpp 2: Unable to open include file 'qpushbutton.h'
Error E2451 QtTest1.cpp 7: Undefined symbol 'QApplication' in function main(int,
char * *)
Error E2379 QtTest1.cpp 7: Statement missing ; in function main(int,char * *)
Error E2451 QtTest1.cpp 9: Undefined symbol 'QPushButton' in function main(int,c
har * *)
Error E2379 QtTest1.cpp 9: Statement missing ; in function main(int,char * *)
Error E2451 QtTest1.cpp 10: Undefined symbol 'hello' in function main(int,char *
 *)
Error E2451 QtTest1.cpp 12: Undefined symbol 'a' in function main(int,char * *)
Warning W8057 QtTest1.cpp 15: Parameter 'argc' is never used in function main(in
t,char * *)
Warning W8057 QtTest1.cpp 15: Parameter 'argv' is never used in function main(in
t,char * *)
*** 8 errors in Compile ***

Z:\CPP\schule\QtTest1>pause
Drücken Sie eine beliebige Taste . . .
Was fehlt? Was mach ich falsch? bitte, helft mir, ist dringen und ich bin langsam am verzweiffeln.

Verfasst: 1. März 2005 16:55
von dilorenzo
Hi!

QMAKESPEC muesste (glaub ich) nur win32-borland sein.

und beim Kompilieren fehlen die Library und Include Verzeichnisse.

versuch mal einfach in dem Verzeichnis:
qmake -project
qmake QtTest1.pro
make

Ciao

Verfasst: 1. März 2005 17:44
von delay
und beim Kompilieren fehlen die Library und Include Verzeichnisse.
und wie müsste das z.B. aussehen? Sorry für die blöde Frage. Hab irgendwie 0 ahnung.

Verfasst: 2. März 2005 08:35
von dilorenzo
Das tolle an qmake ist ja, dass Du Dir darüber keine Gedanken mehr machen brauchst.
Wenn Du doch wissen willst was beim 'make' passiert schau in die Datei 'Makefile'