[英]qt gui project error at makefile
I've just installed qt sdk and qt eclipse plugin on Windows 7,and afterwards when i created a new gui project, i got this 2 errors at building: 我刚刚在Windows 7上安装了qt sdk和qt eclipse插件,然后当我创建一个新的gui项目时,在构建时遇到了这2个错误:
***make missing separator.Stop.
and 和
make:***[debug]Error 2
The first error appears in 第一个错误出现在
{.}.cpp{debug\}.obj::
$(CXX) -c $(CXXFLAGS) $(INCPATH) -Fodebug\ @<<
$<
<<//here(it doesn't find any separator)
How can i solve this 2 errors? 我该如何解决这2个错误?
My makefile: 我的makefile:
#############################################################################
# Makefile for building: lala
# Generated by qmake (2.01a) (Qt 4.8.1) on: Wed May 23 11:23:51 2012
# Project: lala.pro
# Template: app
#############################################################################
####### Compiler, tools and options
CC = cl
CXX = cl
DEFINES = -DUNICODE -DWIN32 -DQT_LARGEFILE_SUPPORT -DQT_DLL -DQT_GUI_LIB - DQT_CORE_LIB -DQT_HAVE_MMX -DQT_HAVE_3DNOW -DQT_HAVE_SSE -DQT_HAVE_MMXEXT -DQT_HAVE_SSE2 - DQT_THREAD_SUPPORT
CFLAGS = -nologo -Zm200 -Zc:wchar_t- -Zi -MDd -W3 $(DEFINES)
CXXFLAGS = -nologo -Zm200 -Zc:wchar_t- -Zi -MDd -GR -EHsc -W3 -w34100 -w34189 $(DEFINES)
INCPATH = -I"..\..\..\..\QtSDK\Desktop\Qt\4.8.1\msvc2010\include\QtCore" - I"..\..\..\..\QtSDK\Desktop\Qt\4.8.1\msvc2010\include\QtGui" -I"..\..\..\..\QtSDK\Desktop\Qt\4.8.1\msvc2010\include" - I"..\..\..\..\QtSDK\Desktop\Qt\4.8.1\msvc2010\include\ActiveQt" -I"debug" -I"." -I"..\..\..\..\QtSDK\Desktop\Qt\4.8.1\msvc2010\mkspecs\default"
LINK = link
LFLAGS = /LIBPATH:"c:\QtSDK\Desktop\Qt\4.8.1\msvc2010\lib" /NOLOGO /DYNAMICBASE /NXCOMPAT /DEBUG /MANIFEST /MANIFESTFILE:"debug\lala.intermediate.manifest" /SUBSYSTEM:WINDOWS "/MANIFESTDEPENDENCY:type='win32' name='Microsoft.Windows.Common- Controls' version='6.0.0.0' publicKeyToken='6595b64144ccf1df' language='*' processorArchitecture='*'"
LIBS = c:\QtSDK\Desktop\Qt\4.8.1\msvc2010\lib\qtmaind.lib c:\QtSDK\Desktop\Qt\4.8.1\msvc2010\lib\QtGuid4.lib c:\QtSDK\Desktop\Qt\4.8.1\msvc2010\lib\QtCored4.lib
QMAKE = c:\QtSDK\Desktop\Qt\4.8.1\msvc2010\bin\qmake
IDC = c:\QtSDK\Desktop\Qt\4.8.1\msvc2010\bin\idc.exe
IDL = midl
ZIP = zip -r -9
DEF_FILE =
RES_FILE =
COPY = copy /y
SED =
COPY_FILE = $(COPY)
COPY_DIR = xcopy /s /q /y /i
DEL_FILE = del
DEL_DIR = rmdir
MOVE = move
CHK_DIR_EXISTS= if not exist
MKDIR = mkdir
INSTALL_FILE = $(COPY_FILE)
INSTALL_PROGRAM = $(COPY_FILE)
INSTALL_DIR = $(COPY_DIR)
####### Output directory
OBJECTS_DIR = debug
####### Files
SOURCES = main.cpp \
lala.cpp debug\moc_lala.cpp
OBJECTS = debug\main.obj \
debug\lala.obj \
debug\moc_lala.obj
DIST =
QMAKE_TARGET = lala
DESTDIR = debug\ #avoid trailing-slash linebreak
TARGET = lala.exe
DESTDIR_TARGET = debug\lala.exe
####### Implicit rules
.SUFFIXES: .c .cpp .cc .cxx
{.}.cpp{debug\}.obj::
$(CXX) -c $(CXXFLAGS) $(INCPATH) -Fodebug\ @<<
$<
<<
{.}.cc{debug\}.obj::
$(CXX) -c $(CXXFLAGS) $(INCPATH) -Fodebug\ @<<
$<
<<
{.}.cxx{debug\}.obj::
$(CXX) -c $(CXXFLAGS) $(INCPATH) -Fodebug\ @<<
$<
<<
{.}.c{debug\}.obj::
$(CC) -c $(CFLAGS) $(INCPATH) -Fodebug\ @<<
$<
<<
{debug}.cpp{debug\}.obj::
$(CXX) -c $(CXXFLAGS) $(INCPATH) -Fodebug\ @<<
$<
<<
{debug}.cc{debug\}.obj::
$(CXX) -c $(CXXFLAGS) $(INCPATH) -Fodebug\ @<<
$<
<<
{debug}.cxx{debug\}.obj::
$(CXX) -c $(CXXFLAGS) $(INCPATH) -Fodebug\ @<<
$<
<<
{debug}.c{debug\}.obj::
$(CC) -c $(CFLAGS) $(INCPATH) -Fodebug\ @<<
$<
<<
####### Build rules
first: all
all: Makefile.Debug $(DESTDIR_TARGET)
$(DESTDIR_TARGET): ui_lala.h $(OBJECTS)
$(LINK) $(LFLAGS) /OUT:$(DESTDIR_TARGET) @<<
$(OBJECTS) $(LIBS)
<<
mt.exe -nologo -manifest "debug\lala.intermediate.manifest" - outputresource:$(DESTDIR_TARGET);1
qmake: FORCE
@$(QMAKE) -o Makefile.Debug lala.pro
dist:
$(ZIP) lala.zip $(SOURCES) $(DIST) lala.pro ..\..\..\..\QtSDK\Desktop\Qt\4.8.1\msvc2010\mkspecs\qconfig.pri ..\..\..\..\QtSDK\Desktop\Qt\4.8.1\msvc2010\mkspecs\modules\qt_webkit_version.pri ..\..\..\..\QtSDK\Desktop\Qt\4.8.1\msvc2010\mkspecs\features\qt_functions.prf ..\..\..\..\QtSDK\Desktop\Qt\4.8.1\msvc2010\mkspecs\features\qt_config.prf ..\..\..\..\QtSDK\Desktop\Qt\4.8.1\msvc2010\mkspecs\features\exclusive_builds.prf ..\..\..\..\QtSDK\Desktop\Qt\4.8.1\msvc2010\mkspecs\features\default_pre.prf ..\..\..\..\QtSDK\Desktop\Qt\4.8.1\msvc2010\mkspecs\features\win32\default_pre.prf ..\..\..\..\QtSDK\Desktop\Qt\4.8.1\msvc2010\mkspecs\features\debug.prf ..\..\..\..\QtSDK\Desktop\Qt\4.8.1\msvc2010\mkspecs\features\debug_and_release.prf ..\..\..\..\QtSDK\Desktop\Qt\4.8.1\msvc2010\mkspecs\features\default_post.prf ..\..\..\..\QtSDK\Desktop\Qt\4.8.1\msvc2010\mkspecs\features\win32\default_post.prf ..\..\..\..\QtSDK\Desktop\Qt\4.8.1\msvc2010\mkspecs\features\build_pass.prf ..\..\..\..\QtSDK\Desktop\Qt\4.8.1\msvc2010\mkspecs\features\win32\rtti.prf ..\..\..\..\QtSDK\Desktop\Qt\4.8.1\msvc2010\mkspecs\features\win32\exceptions.prf ..\..\..\..\QtSDK\Desktop\Qt\4.8.1\msvc2010\mkspecs\features\win32\stl.prf ..\..\..\..\QtSDK\Desktop\Qt\4.8.1\msvc2010\mkspecs\features\shared.prf ..\..\..\..\QtSDK\Desktop\Qt\4.8.1\msvc2010\mkspecs\features\win32\embed_manifest_exe.prf ..\..\..\..\QtSDK\Desktop\Qt\4.8.1\msvc2010\mkspecs\features\win32\embed_manifest_dll.prf ..\..\..\..\QtSDK\Desktop\Qt\4.8.1\msvc2010\mkspecs\features\warn_on.prf ..\..\..\..\QtSDK\Desktop\Qt\4.8.1\msvc2010\mkspecs\features\qt.prf ..\..\..\..\QtSDK\Desktop\Qt\4.8.1\msvc2010\mkspecs\features\win32\thread.prf ..\..\..\..\QtSDK\Desktop\Qt\4.8.1\msvc2010\mkspecs\features\moc.prf ..\..\..\..\QtSDK\Desktop\Qt\4.8.1\msvc2010\mkspecs\features\win32\windows.prf ..\..\..\..\QtSDK\Desktop\Qt\4.8.1\msvc2010\mkspecs\features\resources.prf ..\..\..\..\QtSDK\Desktop\Qt\4.8.1\msvc2010\mkspecs\features\uic.prf ..\..\..\..\QtSDK\Desktop\Qt\4.8.1\msvc2010\mkspecs\features\yacc.prf ..\..\..\..\QtSDK\Desktop\Qt\4.8.1\msvc2010\mkspecs\features\lex.prf ..\..\..\..\QtSDK\Desktop\Qt\4.8.1\msvc2010\mkspecs\features\include_source_dir.prf c:\QtSDK\Desktop\Qt\4.8.1\msvc2010\lib\qtmaind.prl HEADERS RESOURCES IMAGES SOURCES OBJECTIVE_SOURCES FORMS YACCSOURCES YACCSOURCES LEXSOURCES
clean: compiler_clean
-$(DEL_FILE) debug\main.obj debug\lala.obj debug\moc_lala.obj
-$(DEL_FILE) debug\lala.intermediate.manifest debug\lala.exp debug\lala.ilk vc*.pdb vc*.idb
distclean: clean
-$(DEL_FILE) debug\lala.pdb
-$(DEL_FILE) $(DESTDIR_TARGET)
-$(DEL_FILE) Makefile.Debug
check: first
mocclean: compiler_moc_header_clean compiler_moc_source_clean
mocables: compiler_moc_header_make_all compiler_moc_source_make_all
compiler_moc_header_make_all: debug\moc_lala.cpp
compiler_moc_header_clean:
-$(DEL_FILE) debug\moc_lala.cpp
debug\moc_lala.cpp: ui_lala.h \
lala.h
C:\QtSDK\Desktop\Qt\4.8.1\msvc2010\bin\moc.exe $(DEFINES) $(INCPATH) - D_MSC_VER=1600 -DWIN32 lala.h -o debug\moc_lala.cpp
compiler_rcc_make_all:
compiler_rcc_clean:
compiler_image_collection_make_all: qmake_image_collection.cpp
compiler_image_collection_clean:
-$(DEL_FILE) qmake_image_collection.cpp
compiler_moc_source_make_all:
compiler_moc_source_clean:
compiler_uic_make_all: ui_lala.h
compiler_uic_clean:
-$(DEL_FILE) ui_lala.h
ui_lala.h: lala.ui
c:\QtSDK\Desktop\Qt\4.8.1\msvc2010\bin\uic.exe lala.ui -o ui_lala.h
compiler_yacc_decl_make_all:
compiler_yacc_decl_clean:
compiler_yacc_impl_make_all:
compiler_yacc_impl_clean:
compiler_lex_make_all:
compiler_lex_clean:
compiler_clean: compiler_moc_header_clean compiler_uic_clean
####### Compile
debug\main.obj: main.cpp lala.h \
ui_lala.h
debug\lala.obj: lala.cpp lala.h \
ui_lala.h
debug\moc_lala.obj: debug\moc_lala.cpp
####### Install
install: FORCE
uninstall: FORCE
FORCE:
This might be due to some mistakes in your Makefile
. 这可能是由于
Makefile
一些错误所致。
make***make is a fatal error
,So it can't continue with this error.if you have line no: info that is indicated by missing separator error, Try putting TAB in that line and re-run make
. make***make is a fatal error
,因此无法继续发生此错误。如果您没有行号:缺少分隔符错误指示的信息,请尝试将TAB放在该行中并重新运行make
。
Other separator characters are :
, =
etc. And also check there are spaces b/n assignments in Makefile. 其他分隔符是
:
, =
等。还要检查Makefile中是否有空格b / n分配。
If you have downloaded Qt SDK which is compiled using qmake/gcc
tool-chain, then you need make specification file (win32-g++) which uses g++
as a compiler and not cl
(Microsoft Visual C++ Compiler) as your specification file suggests. 如果您下载了使用
qmake/gcc
工具链编译的Qt SDK,则需要make规格文件(win32-g ++),该文件使用g++
作为编译器,而不是cl
(Microsoft Visual C ++编译器)作为规格文件建议。
But If you have Qt SDK which is compiled using nmake/cl
tool-chain, then your specification file is valid, just you need to use nmake
instead of qmake
. 但是,如果您具有使用
nmake/cl
工具链编译的Qt SDK,则您的规范文件有效,只需要使用nmake
而不是qmake
。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.