make funktioniert nicht

Alles zu Entwicklungsumgebungen und Editoren für Qt
Antworten
tobit
Beiträge: 6
Registriert: 2. August 2011 16:32

make funktioniert nicht

Beitrag von tobit »

Hallo zusammen,

ich habe unter Windows Qt 4.7.3 mit dem MinGW-Compiler installiert. Leider schaffe ich es nicht, das obligatorische Hello-World-Programm zu erzeugen. Wie im Buch von Blanchette und Summerfield beschrieben, habe ich in einem Ordner hello die Datei hello.cpp erzeugt, dann in diesem Ordner mittels qmake -project und qmake hello.pro die Dateien hello.pro und Makefile erzeugt.

Wenn ich jetzt make aufrufe, erscheint folgende Meldung:
Der Befehl "make" ist entweder falsch geschrieben oder konnte nicht gefunden werden.
Das ist auch nicht weiter verwunderlich, denn im bin-Ordner des MinGW-Compilers befindet sich keine Datei make.exe.

Stattdessen befindet sich in diesem Ordner eine Datei mingw32-make.exe. Diese kann ich zwar problemlos aufrufen, aber anscheinend passiert nichts. Eine Datei hello.exe wird dadurch jedenfalls nicht erzeugt.

Kann mir jemand weiterhelfen? Bin dankbar für jeden Tipp!

Viele Grüße
tobit
Christian81
Beiträge: 7319
Registriert: 26. August 2004 14:11
Wohnort: Bremen
Kontaktdaten:

Re: make funktioniert nicht

Beitrag von Christian81 »

Bei MinGW ist es mingw32-make
MfG Christian

'Funktioniert nicht' ist keine Fehlerbeschreibung
tobit
Beiträge: 6
Registriert: 2. August 2011 16:32

mingw32-make erzeugt keine .exe-Datei

Beitrag von tobit »

Hallo Christian,

vielen Dank für deine Antwort! Dann brauche ich über die fehlende make-Datei nicht mehr nachzudenken.

Bleibt das Problem, dass der Aufruf von mingw32-make keine .exe Datei erzeugt, sondern anscheinend gar nichts tut. In der Eingabeaufforderung erscheint auch keinerlei Meldung nach diesem Aufruf.

Hat jemand eine Idee, was ich tun kann?

Viele Grüße
tobit
Christian81
Beiträge: 7319
Registriert: 26. August 2004 14:11
Wohnort: Bremen
Kontaktdaten:

Re: make funktioniert nicht

Beitrag von Christian81 »

Wenn ein gültiges Makefile im aktuellen Verzeichnis ist erzeugt mingw32-make auch das was da drin steht.
MfG Christian

'Funktioniert nicht' ist keine Fehlerbeschreibung
tobit
Beiträge: 6
Registriert: 2. August 2011 16:32

Re: make funktioniert nicht

Beitrag von tobit »

Danke für deine erneute Antwort!

Hier der Inhalt des Makefiles:

Code: Alles auswählen

#############################################################################
# Makefile for building: hello
# Generated by qmake (2.01a) (Qt 4.7.3) on: Di 2. Aug 16:19:04 2011
# Project:  hello.pro
# Template: subdirs
# Command: c:\Programme\QtSDK\Desktop\Qt\4.7.3\mingw\bin\qmake.exe -o Makefile hello.pro
#############################################################################

first: make_default
MAKEFILE      = Makefile
QMAKE         = c:\Programme\QtSDK\Desktop\Qt\4.7.3\mingw\bin\qmake.exe
DEL_FILE      = del
CHK_DIR_EXISTS= if not exist
MKDIR         = mkdir
COPY          = copy /y
COPY_FILE     = $(COPY)
COPY_DIR      = xcopy /s /q /y /i
INSTALL_FILE  = $(COPY_FILE)
INSTALL_PROGRAM = $(COPY_FILE)
INSTALL_DIR   = $(COPY_DIR)
DEL_FILE      = del
SYMLINK       = 
DEL_DIR       = rmdir
MOVE          = move
CHK_DIR_EXISTS= if not exist
MKDIR         = mkdir
SUBTARGETS    = 


Makefile: hello.pro  ..\..\Desktop\Qt\4.7.3\mingw\mkspecs\win32-borland\qmake.conf ..\..\Desktop\Qt\4.7.3\mingw\mkspecs\qconfig.pri \
		..\..\Desktop\Qt\4.7.3\mingw\mkspecs\modules\qt_webkit_version.pri \
		..\..\Desktop\Qt\4.7.3\mingw\mkspecs\features\qt_functions.prf \
		..\..\Desktop\Qt\4.7.3\mingw\mkspecs\features\qt_config.prf \
		..\..\Desktop\Qt\4.7.3\mingw\mkspecs\features\exclusive_builds.prf \
		..\..\Desktop\Qt\4.7.3\mingw\mkspecs\features\default_pre.prf \
		..\..\Desktop\Qt\4.7.3\mingw\mkspecs\features\win32\default_pre.prf \
		..\..\Desktop\Qt\4.7.3\mingw\mkspecs\features\debug.prf \
		..\..\Desktop\Qt\4.7.3\mingw\mkspecs\features\debug_and_release.prf \
		..\..\Desktop\Qt\4.7.3\mingw\mkspecs\features\default_post.prf \
		..\..\Desktop\Qt\4.7.3\mingw\mkspecs\features\win32\default_post.prf \
		..\..\Desktop\Qt\4.7.3\mingw\mkspecs\features\win32\rtti.prf \
		..\..\Desktop\Qt\4.7.3\mingw\mkspecs\features\win32\exceptions.prf \
		..\..\Desktop\Qt\4.7.3\mingw\mkspecs\features\win32\stl.prf \
		..\..\Desktop\Qt\4.7.3\mingw\mkspecs\features\shared.prf \
		..\..\Desktop\Qt\4.7.3\mingw\mkspecs\features\warn_on.prf \
		..\..\Desktop\Qt\4.7.3\mingw\mkspecs\features\qt.prf \
		..\..\Desktop\Qt\4.7.3\mingw\mkspecs\features\win32\thread.prf \
		..\..\Desktop\Qt\4.7.3\mingw\mkspecs\features\moc.prf \
		..\..\Desktop\Qt\4.7.3\mingw\mkspecs\features\win32\windows.prf \
		..\..\Desktop\Qt\4.7.3\mingw\mkspecs\features\resources.prf \
		..\..\Desktop\Qt\4.7.3\mingw\mkspecs\features\uic.prf \
		..\..\Desktop\Qt\4.7.3\mingw\mkspecs\features\yacc.prf \
		..\..\Desktop\Qt\4.7.3\mingw\mkspecs\features\lex.prf \
		..\..\Desktop\Qt\4.7.3\mingw\mkspecs\features\include_source_dir.prf
	$(QMAKE) -o Makefile hello.pro
..\..\Desktop\Qt\4.7.3\mingw\mkspecs\qconfig.pri:
..\..\Desktop\Qt\4.7.3\mingw\mkspecs\modules\qt_webkit_version.pri:
..\..\Desktop\Qt\4.7.3\mingw\mkspecs\features\qt_functions.prf:
..\..\Desktop\Qt\4.7.3\mingw\mkspecs\features\qt_config.prf:
..\..\Desktop\Qt\4.7.3\mingw\mkspecs\features\exclusive_builds.prf:
..\..\Desktop\Qt\4.7.3\mingw\mkspecs\features\default_pre.prf:
..\..\Desktop\Qt\4.7.3\mingw\mkspecs\features\win32\default_pre.prf:
..\..\Desktop\Qt\4.7.3\mingw\mkspecs\features\debug.prf:
..\..\Desktop\Qt\4.7.3\mingw\mkspecs\features\debug_and_release.prf:
..\..\Desktop\Qt\4.7.3\mingw\mkspecs\features\default_post.prf:
..\..\Desktop\Qt\4.7.3\mingw\mkspecs\features\win32\default_post.prf:
..\..\Desktop\Qt\4.7.3\mingw\mkspecs\features\win32\rtti.prf:
..\..\Desktop\Qt\4.7.3\mingw\mkspecs\features\win32\exceptions.prf:
..\..\Desktop\Qt\4.7.3\mingw\mkspecs\features\win32\stl.prf:
..\..\Desktop\Qt\4.7.3\mingw\mkspecs\features\shared.prf:
..\..\Desktop\Qt\4.7.3\mingw\mkspecs\features\warn_on.prf:
..\..\Desktop\Qt\4.7.3\mingw\mkspecs\features\qt.prf:
..\..\Desktop\Qt\4.7.3\mingw\mkspecs\features\win32\thread.prf:
..\..\Desktop\Qt\4.7.3\mingw\mkspecs\features\moc.prf:
..\..\Desktop\Qt\4.7.3\mingw\mkspecs\features\win32\windows.prf:
..\..\Desktop\Qt\4.7.3\mingw\mkspecs\features\resources.prf:
..\..\Desktop\Qt\4.7.3\mingw\mkspecs\features\uic.prf:
..\..\Desktop\Qt\4.7.3\mingw\mkspecs\features\yacc.prf:
..\..\Desktop\Qt\4.7.3\mingw\mkspecs\features\lex.prf:
..\..\Desktop\Qt\4.7.3\mingw\mkspecs\features\include_source_dir.prf:
qmake: qmake_all
	@$(QMAKE) -o Makefile hello.pro

qmake_all:
	@cd .

make_default:
	@cd .
make_first:
	@cd .
all:
	@cd .
clean:
distclean:
	-$(DEL_FILE) Makefile
install_subtargets:
	@cd .
uninstall_subtargets:
	@cd .

debug:

release:

check:

mocclean: compiler_moc_header_clean compiler_moc_source_clean

mocables: compiler_moc_header_make_all compiler_moc_source_make_all
install: install_subtargets 

uninstall:  uninstall_subtargets

Ist dies kein gültiges Makefile zum erzeugen einer .exe-Datei?
Christian81
Beiträge: 7319
Registriert: 26. August 2004 14:11
Wohnort: Bremen
Kontaktdaten:

Re: make funktioniert nicht

Beitrag von Christian81 »

Desktop\Qt\4.7.3\mingw\mkspecs\win32-borland\qmake.conf
Die Makefiles wurden ncht für MinGW sondern für Borland gebaut - damit wird mingw32-make nichts anfangen können... Ist Borland irgendwo installiert?
Siehe auch qmake Doku: http://doc.trolltech.com/4.7/qmake-running.html - speziell '-spec'
MfG Christian

'Funktioniert nicht' ist keine Fehlerbeschreibung
tobit
Beiträge: 6
Registriert: 2. August 2011 16:32

Re: make funktioniert nicht

Beitrag von tobit »

Herzlichen Dank für deine Mühe!

Tatsächlich habe ich auch den Borland Compiler installiert (und finde keine Möglichkeit, ihn zu deinstallieren).

Habe es mit der -spec-Option probiert und folgendes eingegeben:

Code: Alles auswählen

qmake -makefile -spec C:\Programme\QtSDK\Desktop\Qt\4.7.3\mingw\mkspecs\default hello.pro
Wenn ich jetzt mingw32-make starte, erscheint die Meldung

Code: Alles auswählen

mingw32-make: Nothing to be done for 'first'.
obwohl sich im Ordner weiterhin keine exe-Datei befindet.

Hier die Datei hello.pro:

Code: Alles auswählen

######################################################################
# Automatically generated by qmake (2.01a) Do 4. Aug 18:39:55 2011
######################################################################

TEMPLATE = subdirs

# Directories
Und hier die jetzige Datei Makefile:

Code: Alles auswählen

#############################################################################
# Makefile for building: hello
# Generated by qmake (2.01a) (Qt 4.7.3) on: Do 4. Aug 19:29:29 2011
# Project:  hello.pro
# Template: subdirs
# Command: c:\Programme\QtSDK\Desktop\Qt\4.7.3\mingw\bin\qmake.exe -spec ..\..\Desktop\Qt\4.7.3\mingw\mkspecs\default -o Makefile hello.pro
#############################################################################

first: make_default
MAKEFILE      = Makefile
QMAKE         = c:\Programme\QtSDK\Desktop\Qt\4.7.3\mingw\bin\qmake.exe
DEL_FILE      = del
CHK_DIR_EXISTS= if not exist
MKDIR         = mkdir
COPY          = copy /y
COPY_FILE     = $(COPY)
COPY_DIR      = xcopy /s /q /y /i
INSTALL_FILE  = $(COPY_FILE)
INSTALL_PROGRAM = $(COPY_FILE)
INSTALL_DIR   = $(COPY_DIR)
DEL_FILE      = del
SYMLINK       = 
DEL_DIR       = rmdir
MOVE          = move
CHK_DIR_EXISTS= if not exist
MKDIR         = mkdir
SUBTARGETS    = 


Makefile: hello.pro  ../../Desktop/Qt/4.7.3/mingw/mkspecs/default/qmake.conf ../../Desktop/Qt/4.7.3/mingw/mkspecs/qconfig.pri \
		../../Desktop/Qt/4.7.3/mingw/mkspecs/modules/qt_webkit_version.pri \
		../../Desktop/Qt/4.7.3/mingw/mkspecs/features/qt_functions.prf \
		../../Desktop/Qt/4.7.3/mingw/mkspecs/features/qt_config.prf \
		../../Desktop/Qt/4.7.3/mingw/mkspecs/features/exclusive_builds.prf \
		../../Desktop/Qt/4.7.3/mingw/mkspecs/features/default_pre.prf \
		../../Desktop/Qt/4.7.3/mingw/mkspecs/features/win32/default_pre.prf \
		../../Desktop/Qt/4.7.3/mingw/mkspecs/features/debug.prf \
		../../Desktop/Qt/4.7.3/mingw/mkspecs/features/debug_and_release.prf \
		../../Desktop/Qt/4.7.3/mingw/mkspecs/features/default_post.prf \
		../../Desktop/Qt/4.7.3/mingw/mkspecs/features/win32/default_post.prf \
		../../Desktop/Qt/4.7.3/mingw/mkspecs/features/win32/rtti.prf \
		../../Desktop/Qt/4.7.3/mingw/mkspecs/features/win32/exceptions.prf \
		../../Desktop/Qt/4.7.3/mingw/mkspecs/features/win32/stl.prf \
		../../Desktop/Qt/4.7.3/mingw/mkspecs/features/shared.prf \
		../../Desktop/Qt/4.7.3/mingw/mkspecs/features/warn_on.prf \
		../../Desktop/Qt/4.7.3/mingw/mkspecs/features/qt.prf \
		../../Desktop/Qt/4.7.3/mingw/mkspecs/features/win32/thread.prf \
		../../Desktop/Qt/4.7.3/mingw/mkspecs/features/moc.prf \
		../../Desktop/Qt/4.7.3/mingw/mkspecs/features/win32/windows.prf \
		../../Desktop/Qt/4.7.3/mingw/mkspecs/features/resources.prf \
		../../Desktop/Qt/4.7.3/mingw/mkspecs/features/uic.prf \
		../../Desktop/Qt/4.7.3/mingw/mkspecs/features/yacc.prf \
		../../Desktop/Qt/4.7.3/mingw/mkspecs/features/lex.prf \
		../../Desktop/Qt/4.7.3/mingw/mkspecs/features/include_source_dir.prf
	$(QMAKE) -spec ..\..\Desktop\Qt\4.7.3\mingw\mkspecs\default -o Makefile hello.pro
..\..\Desktop\Qt\4.7.3\mingw\mkspecs\qconfig.pri:
..\..\Desktop\Qt\4.7.3\mingw\mkspecs\modules\qt_webkit_version.pri:
..\..\Desktop\Qt\4.7.3\mingw\mkspecs\features\qt_functions.prf:
..\..\Desktop\Qt\4.7.3\mingw\mkspecs\features\qt_config.prf:
..\..\Desktop\Qt\4.7.3\mingw\mkspecs\features\exclusive_builds.prf:
..\..\Desktop\Qt\4.7.3\mingw\mkspecs\features\default_pre.prf:
..\..\Desktop\Qt\4.7.3\mingw\mkspecs\features\win32\default_pre.prf:
..\..\Desktop\Qt\4.7.3\mingw\mkspecs\features\debug.prf:
..\..\Desktop\Qt\4.7.3\mingw\mkspecs\features\debug_and_release.prf:
..\..\Desktop\Qt\4.7.3\mingw\mkspecs\features\default_post.prf:
..\..\Desktop\Qt\4.7.3\mingw\mkspecs\features\win32\default_post.prf:
..\..\Desktop\Qt\4.7.3\mingw\mkspecs\features\win32\rtti.prf:
..\..\Desktop\Qt\4.7.3\mingw\mkspecs\features\win32\exceptions.prf:
..\..\Desktop\Qt\4.7.3\mingw\mkspecs\features\win32\stl.prf:
..\..\Desktop\Qt\4.7.3\mingw\mkspecs\features\shared.prf:
..\..\Desktop\Qt\4.7.3\mingw\mkspecs\features\warn_on.prf:
..\..\Desktop\Qt\4.7.3\mingw\mkspecs\features\qt.prf:
..\..\Desktop\Qt\4.7.3\mingw\mkspecs\features\win32\thread.prf:
..\..\Desktop\Qt\4.7.3\mingw\mkspecs\features\moc.prf:
..\..\Desktop\Qt\4.7.3\mingw\mkspecs\features\win32\windows.prf:
..\..\Desktop\Qt\4.7.3\mingw\mkspecs\features\resources.prf:
..\..\Desktop\Qt\4.7.3\mingw\mkspecs\features\uic.prf:
..\..\Desktop\Qt\4.7.3\mingw\mkspecs\features\yacc.prf:
..\..\Desktop\Qt\4.7.3\mingw\mkspecs\features\lex.prf:
..\..\Desktop\Qt\4.7.3\mingw\mkspecs\features\include_source_dir.prf:
qmake: qmake_all FORCE
	@$(QMAKE) -spec ..\..\Desktop\Qt\4.7.3\mingw\mkspecs\default -o Makefile hello.pro

qmake_all: FORCE

make_default: FORCE
make_first: FORCE
all: FORCE
clean: FORCE
distclean: FORCE
	-$(DEL_FILE) Makefile
install_subtargets: FORCE
uninstall_subtargets: FORCE

debug:

release:

check:

mocclean: compiler_moc_header_clean compiler_moc_source_clean

mocables: compiler_moc_header_make_all compiler_moc_source_make_all
install: install_subtargets  FORCE

uninstall:  uninstall_subtargets FORCE

FORCE:

Würde mich über weitere Hilfe sehr freuen!
Christian81
Beiträge: 7319
Registriert: 26. August 2004 14:11
Wohnort: Bremen
Kontaktdaten:

Re: make funktioniert nicht

Beitrag von Christian81 »

Die pro-Datei hat auch ein wenig zu wenig... wenn Du keine Sourcen und Header angibst - was soll passieren? Aber ein wenig Doku lesen sollte nicht schaden... http://doc.trolltech.com/4.7/qmake-project-files.html
MfG Christian

'Funktioniert nicht' ist keine Fehlerbeschreibung
tobit
Beiträge: 6
Registriert: 2. August 2011 16:32

Re: make funktioniert nicht

Beitrag von tobit »

Du bist ein Held, danke für deine wiederholte Hilfe!

Habe jetzt per Hand in der Datei hello.pro die Zeile "SOURCES = hello.cpp" ergänzt, so dass die Datei hello.pro folgendermaßen aussieht:

Code: Alles auswählen

######################################################################
# Automatically generated by qmake (2.01a) Fr 5. Aug 08:47:11 2011
######################################################################

SOURCES = hello.cpp

TEMPLATE = subdirs

# Directories
Wenn ich jetzt "qmake hello.pro" (bzw. selbigen Befehl mit dem spec-Parameter) aufrufe, erscheint folgende Meldung:

Code: Alles auswählen

WARNING: Failure to find: hello.cpp
obwohl im Ordner hello (in dem sich die Datei hello.pro befindet) sehr wohl eine Datei hello.cpp liegt.

Woran könnte das liegen?
Christian81
Beiträge: 7319
Registriert: 26. August 2004 14:11
Wohnort: Bremen
Kontaktdaten:

Re: make funktioniert nicht

Beitrag von Christian81 »

Doku lesen sit schon schwer... Was willst Du mit 'template' erreichen?
MfG Christian

'Funktioniert nicht' ist keine Fehlerbeschreibung
tobit
Beiträge: 6
Registriert: 2. August 2011 16:32

Re: make funktioniert nicht

Beitrag von tobit »

Hallo Christian,

(Die Template-Option habe ich nicht selbst eingegeben, sondern sie wurde automatisch durch den Befehl qmake -project erzeugt.)

Jetzt hat es endlich geklappt! Mir war ein peinlicher Fehler unterlaufen: Die Datei, die mir als hello.cpp angezeigt wurde, hieß in Wirklichkeit hello.cpp.txt.

Ohne deine Hilfe hätte ich das nie herausgefunden! Also ganz herzlichen Dank!

Viele Grüße
tobit
Antworten