"missing separator" error in Makefile
-
wrote on 16 Feb 2011, 14:44 last edited by
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
-
wrote on 16 Feb 2011, 16:18 last edited by
- 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).
-
wrote on 16 Feb 2011, 17:57 last edited by
Thank you for your reply, peppe.
There are real tabs before both $(CXX) and $<.
After setting the PATH and invoking mingw32-make.exe (without a full path to it), the same error occurs at the same location in Makefile.Debug.
-
wrote on 16 Feb 2011, 19:14 last edited by
That's weird. Can you pastebin the whole makefile?
-
wrote on 9 Jun 2011, 12:32 last edited by
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.
-
-
wrote on 1 Dec 2022, 01:20 last edited by
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.