Seite 1 von 1

Probs mit qmake und konsorten

Verfasst: 13. Oktober 2004 11:00
von KuhTee;
Sry wenn meine Frage jetzt sehr Newbie Like it, aber ich bin wohl einfach zu blöd. ;-)

Ich habe Qt auf meinem G4 Power Book istallt, und es funzt auch alles. Jetzt wollte ich anfangen das erste Tutorial zu machen, aber weiss nich wie ich eine .cpp Datei mittels qmake -project && qmake -makefile ausführbar kriege. Meine datei.cpp liegt im qmake Ordner von qt. Wenn ich ein qmake -project darauf mache, passiert erstmal scheinbar garnichts. Nach genauerem hinsehen bemerkte ich, dass es die datei.cpp einfach mit den project informationen überschrieben hat. Makefile generieren funzt aber irgendwie nicht. Könnt Ihr mir Helfen?

Im TuT steht einfach nur
To compile a C++ application you need to create a makefile. The easiest way to create a makefile for Qt is to use the qmake build tool supplied with Qt. If you've saved main.cpp in its own directory, all you have to do is:
qmake -project
qmake
naja ganz eideutig find ich diese beschreibung nicht..



Danke schonmal!


-KuhTee; )

Verfasst: 13. Oktober 2004 12:07
von needle
hi,

ich gehe jetzt mal davon aus, dass du deinen quelltext in ein eigenes verzeichnis legst und nicht in das qt/bin verzeichnis. (aber jedem wie er will ;-) )

wenn ich ein verzeichnis 'projectdir' anlege und darin eine datei irgendeinname.cpp editiere

Code: Alles auswählen

// zwar nicht cute aber fuer qmake test ok
int main()
{
return 0;
}
und dann per commandline in dem projectdir ein

Code: Alles auswählen

qmake -project
ausführe, dann legt qmake ein projectdir.pro an welches ca so aussehen sollte :

Code: Alles auswählen

######################################################################
# Automatically generated by qmake (1.06c) Wed Oct 13 12:00:38 2004
######################################################################

TEMPLATE = app
CONFIG -= moc
INCLUDEPATH += .

# Input
SOURCES += irgendeinname.cpp
dann legt man per

Code: Alles auswählen

qmake projectdir.pro
ein Makefile an mit dem man per make (oder nmake oder wie auch immer nach compiler) dann den compilevorgang starten kann.

tja so sollte es sein. wenn das qmake bei dir wirklich das .cpp file ueberschreibt, koennte das eigentlich nur sein, dass du ein -o datei.cpp angehangen hast. ansonsten bitte mal genauer spezifizieren.

Code: Alles auswählen

Usage: qmake [mode] [options] [files]

   QMake has two modes, one mode for generating project files based on
some heuristics, and the other for generating makefiles. Normally you
shouldn't need to specify a mode, as makefile generation is the default
mode for qmake, but you may use this to test qmake on an existing project

Mode:
        -project       Put qmake into project file generation mode
                       In this mode qmake interprets files as files to
                       be built,
                       defaults to *.c; *.ui; *.y; *.l; *.ts; *.h; *.hpp; *.hh; *.H; *.hxx; *.cpp; *.cc; *.cxx; *.C
        -makefile      Put qmake into makefile generation mode (default)
                       In this mode qmake interprets files as project files to
                       be processed, if skipped qmake will try to find a project
                       file in your current working directory

Warnings Options:
        -Wnone         Turn off all warnings
        -Wall          Turn on all warnings
        -Wparser       Turn on parser warnings
        -Wlogic        Turn on logic warnings

Options:
         * You can place any variable assignment in options and it will be     *
         * processed as if it was in [files]. These assignments will be parsed *
         * before [files].                                                     *
        -o file        Write output to file
        -unix          Run in unix mode
        -win32         Run in win32 mode
        -macx          Run in Mac OS X mode
        -d             Increase debug level
        -t templ       Overrides TEMPLATE as templ
        -tp prefix     Overrides TEMPLATE so that prefix is prefixed into the value
        -help          This help
        -v             Version information
        -after         All variable assignments after this will be
                       parsed after [files]
        -cache file    Use file as cache           [makefile mode only]
        -spec spec     Use spec as QMAKESPEC       [makefile mode only]
        -nocache       Don't use a cache file      [makefile mode only]
        -nodepend      Don't generate dependencies [makefile mode only]
        -nomoc         Don't generate moc targets  [makefile mode only]
        -nopwd         Don't look for files in pwd [ project mode only]
        -norecursive   Don't do a recursive search [ project mode only]
gruss,

needle

Verfasst: 14. Oktober 2004 13:20
von KuhTee;
Hallo und Danke für die Antwort.
ich gehe jetzt mal davon aus, dass du deinen quelltext in ein eigenes verzeichnis legst und nicht in das qt/bin verzeichnis.
Die erste Testdatei habe ich tatsächlich im qt/qmake verzeichnis erstellt, was wohl auch das problem war. Nachdem ich im Homeverzeichnis dasselbe probiert habe funzten auch qmake -project und qmake sowie make einwandtfrei.



schönen gruss,

Kuh Tee;)