"missing separator" error in Makefile
-
Hi.
I'm working my way through the Qt tutorial on qmake on my Windows XP machine.
[The tutorial files are part of the distribution: C:\Qt\2010.05\qt\examples\qmake\tutorial].I've successfully used qmake to generate Makefile, Makefile.Debug, and Makefile.Release.
[I used the command qmake -o Makefile hello.pro].I'm now trying to use mingw32-make.exe to build an executable, using the following command:
C:\Qt\2010.05\mingw\bin\mingw32-make.exeHowever, I get the following error:
@
C:\Qt\2010.05\qt\examples\qmake\tutorial>C:\Qt\2010.05\mingw\bin\mingw32-make.exe
C:/Qt/2010.05/mingw/bin/mingw32-make -f Makefile.Debug all
mingw32-make[1]: Entering directoryC:/Qt/2010.05/qt/examples/qmake/tutorial' Makefile.Debug:60: *** missing separator. Stop. mingw32-make[1]: Leaving directory
C:/Qt/2010.05/qt/examples/qmake/tutorial'
mingw32-make: *** [debug-all] Error 2
@The relevant lines in my Makefile.Debug appear to be:
@
{.}.cpp{tmp\obj\debug_shared}.obj::
$(CXX) -c $(CXXFLAGS) $(INCPATH) -Fotmp\obj\debug_shared\ @<<
$<
<<@
Thank you for any advice you can provide.
Jayson
-
- Can you check if there a REAL TAB (i.e. '\t') before $(CXX) or $< and not just some spaces?
- Can you check if invoking the compiler by a relative path (or in general one that doesn't contain ':') the problem disappears? (like, ......\bin\mingw32-make ; or set PATH).
-
Hello,
I had the same problem, but succeed in fixing it now.
I develop with Qt 4.6.3 on Win 7. My project was first written on Visual Studio. I have then installed MinGW.
I have made several things to fix the problem:
-
QMAKESPEC: this env variable was not defined on my computer. Thus, qmake created the makefile for Visual Studio.
I defined QMAKESPEC with the value %QTDIR%\mkspecs\win32-g++. Now the makefile is suitable for MinGW. -
make.bat: I use getgnuwin32, which has its make.exe version, and conflicts with MinGW.
In the bin directory of MinGW (c:\MinGW\bin for me), I created a file make.bat with these lines:
@echo off
mingw32-make %and I added the path of this directory in my PATH variable, before the directory of GetGnuWin32. In a new command line, the command which make returns the one of MinGW. At that point, building the Qt project works.
I hope this will help someone.
-
-
I see the same issue as the poster and finally resolved this issue withing the following way.
The issue happened because the make spec is different with the way you generate the makefile.
As I'm using the mingw32-make to make this QT project, the right makefile spec should be "win32-g++".So I re-generate the makefile using the following command:
qmake -spec %YOUR_QTPATH%\mkspecs\win32-g++then, the issue shoule be resolved.