Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct
"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).
-
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.
-
That's weird. Can you pastebin the whole makefile?
-
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.
-