我有一个C项目,正在使用NMake编译该项目。但是,我有一个错误,并且我一直很难找出导致它的原因。有谁知道如何调试使用nmake编译的Visual Studio C项目,甚至不知道是什么导致以下错误?
输出文件
------重建全部开始:项目:DirectTopUp,配置:调试Win32 ------
Microsoft(R)程序维护实用程序版本10.00.30319.01
版权所有(C)Microsoft Corporation。版权所有。
删除obj * .o
sed:文件GCCErrFix.sed第1行:未知命令:`
C:\ Program Files \ MSBuild \ Microsoft.Cpp \ v4.0 \ Microsoft.MakeFile.Targets(43,5):错误MSB3073:命令“ NMAKE / f make / makefile / a 2
==========全部重建:0成功,1失败,0跳过===========
制作文件
path = c:\ windows; c:\ windows \ system32; $(GCCROOT)\ build \ bin#NAME = Direct-Top-UpNAME = JOSECARDGCCDIR = $(GCCROOT)\buildGCCBIN = $(GCCDIR)\binGCCLIB = $(GCCDIR)\libGCCLIBELF = $(GCCDIR)\libelfGCCINC = $(GCCDIR)\includeLOCSRC = .\srcLOCOBJ = .\objLOCOUT = .\outLOCINC = .\srcLOCLIB = ..\libJOSINCDIR = $(JOSAPIINC)JOSLIBDIR = $(JOSAPILIB)LIB = $(GCCLIB)\libc.aJOSLIB = pc1000api(v21)WLSLIB = pc1000idwlsapi(v23)ASM = $(GCCDIR)\BIN\arm-elf-asGCC = $(GCCDIR)\BIN\arm-elf-gcc -O3 -I$(GCCINC) -I$(JOSINCDIR) -I$(LOCINC) -mlittle-endian -mcpu=arm9 -cLINK = $(GCCDIR)\BIN\arm-elf-ld -Tldscript -L$(GCCLIB) -L$(GCCLIBELF) -L$(JOSLIBDIR)CCFLAG = -O3 -I..\build\include -mlittle-endian -mcpu=arm9OBJ = $(LOCOBJ)\init.o \ $(LOCOBJ)\JOSECARD.o \ $(LOCOBJ)\mamenus.o \ $(LOCOBJ)\madevices.o \ $(LOCOBJ)\magraphics.o \ $(LOCOBJ)\malib.o \ $(LOCOBJ)\mamessage.o \ $(LOCOBJ)\maoper.o \ $(LOCOBJ)\matrans.o \ $(LOCOBJ)\rijndael-alg-ref.o \ $(LOCOBJ)\rijndael-api-ref.o \ $(LOCOBJ)\maui.o \ $(LOCOBJ)\madisplay.o \ $(LOCOBJ)\mafiles.o \ $(LOCOBJ)\mabatch.o \ $(LOCOBJ)\digibcd.o \ $(LOCOBJ)\digicrypt.o \ $(LOCOBJ)\digimsg.o \ $(LOCOBJ)\digipkt.o \ $(LOCOBJ)\maprinter.o \ $(LOCOBJ)\mareports.o \ $(LOCOBJ)\mareceipt.o \ $(LOCOBJ)\maprotocol.o \ $(LOCOBJ)\GPRScomms.o \ $(LOCOBJ)\POSConvert.o \ $(LOCOBJ)\debug.o# ADS-ROM version$(NAME).elf: $(OBJ) @echo Linking All Modules... $(LINK) -o $(NAME).elf $(OBJ) -l$(WLSLIB) -l$(JOSLIB) -lc -lgcc elftobin $(NAME).elf $(LOCOUT)\$(NAME).bin PC1000---APP# ASM file$(LOCOBJ)\init.o: $(LOCSRC)\init.s @echo Assembling...init.s @$(ASM) $(LOCSRC)\init.s -o $(LOCOBJ)\init.o# C files$(LOCOBJ)\JOSECARD.o: $(LOCSRC)\JOSECARD.c @echo Compiling...JOSECARD.c @$(GCC) $(LOCSRC)\JOSECARD.c -o $(LOCOBJ)\JOSECARD.o$(LOCOBJ)\mamenus.o: $(LOCSRC)\mamenus.c @echo Compiling...mamenus.c @$(GCC) $(LOCSRC)\mamenus.c -o $(LOCOBJ)\mamenus.o$(LOCOBJ)\madevices.o: $(LOCSRC)\madevices.c @echo Compiling...madevices.c @$(GCC) $(LOCSRC)\madevices.c -o $(LOCOBJ)\madevices.o$(LOCOBJ)\magraphics.o: $(LOCSRC)\magraphics.c @echo Compiling...magraphics.c @$(GCC) $(LOCSRC)\magraphics.c -o $(LOCOBJ)\magraphics.o$(LOCOBJ)\malib.o: $(LOCSRC)\malib.c @echo Compiling...malib.c @$(GCC) $(LOCSRC)\malib.c -o $(LOCOBJ)\malib.o$(LOCOBJ)\mamessage.o: $(LOCSRC)\mamessage.c @echo Compiling...mamessage.c @$(GCC) $(LOCSRC)\mamessage.c -o $(LOCOBJ)\mamessage.o$(LOCOBJ)\maoper.o: $(LOCSRC)\maoper.c @echo Compiling...maoper.c @$(GCC) $(LOCSRC)\maoper.c -o $(LOCOBJ)\maoper.o$(LOCOBJ)\matrans.o: $(LOCSRC)\matrans.c @echo Compiling...matrans.c @$(GCC) $(LOCSRC)\matrans.c -o $(LOCOBJ)\matrans.o$(LOCOBJ)\rijndael-alg-ref.o: $(LOCSRC)\rijndael-alg-ref.c @echo Compiling...rijndael-alg-ref.c @$(GCC) $(LOCSRC)\rijndael-alg-ref.c -o $(LOCOBJ)\rijndael-alg-ref.o$(LOCOBJ)\rijndael-api-ref.o: $(LOCSRC)\rijndael-api-ref.c @echo Compiling...rijndael-api-ref.c @$(GCC) $(LOCSRC)\rijndael-api-ref.c -o $(LOCOBJ)\rijndael-api-ref.o$(LOCOBJ)\maui.o: $(LOCSRC)\maui.c @echo Compiling...maui.c @$(GCC) $(LOCSRC)\maui.c -o $(LOCOBJ)\maui.o$(LOCOBJ)\madisplay.o: $(LOCSRC)\madisplay.c @echo Compiling...madisplay.c @$(GCC) $(LOCSRC)\madisplay.c -o $(LOCOBJ)\madisplay.o$(LOCOBJ)\mafiles.o: $(LOCSRC)\mafiles.c @echo Compiling...mafiles.c @$(GCC) $(LOCSRC)\mafiles.c -o $(LOCOBJ)\mafiles.o$(LOCOBJ)\mabatch.o: $(LOCSRC)\mabatch.c @echo Compiling...mabatch.c @$(GCC) $(LOCSRC)\mabatch.c -o $(LOCOBJ)\mabatch.o$(LOCOBJ)\digibcd.o: $(LOCSRC)\digibcd.c @echo Compiling...digibcd.c @$(GCC) $(LOCSRC)\digibcd.c -o $(LOCOBJ)\digibcd.o$(LOCOBJ)\digicrypt.o: $(LOCSRC)\digicrypt.c @echo Compiling...digicrypt.c @$(GCC) $(LOCSRC)\digicrypt.c -o $(LOCOBJ)\digicrypt.o$(LOCOBJ)\digimsg.o: $(LOCSRC)\digimsg.c @echo Compiling...digimsg.c @$(GCC) $(LOCSRC)\digimsg.c -o $(LOCOBJ)\digimsg.o$(LOCOBJ)\digipkt.o: $(LOCSRC)\digipkt.c @echo Compiling...digipkt.c @$(GCC) $(LOCSRC)\digipkt.c -o $(LOCOBJ)\digipkt.o$(LOCOBJ)\maprinter.o: $(LOCSRC)\maprinter.c @echo Compiling...maprinter.c @$(GCC) $(LOCSRC)\maprinter.c -o $(LOCOBJ)\maprinter.o$(LOCOBJ)\mareports.o: $(LOCSRC)\mareports.c @echo Compiling...mareports.c @$(GCC) $(LOCSRC)\mareports.c -o $(LOCOBJ)\mareports.o$(LOCOBJ)\mareceipt.o: $(LOCSRC)\mareceipt.c @echo Compiling...mareceipt.c @$(GCC) $(LOCSRC)\mareceipt.c -o $(LOCOBJ)\mareceipt.o$(LOCOBJ)\maprotocol.o: $(LOCSRC)\maprotocol.c @echo Compiling...maprotocol.c @$(GCC) $(LOCSRC)\maprotocol.c -o $(LOCOBJ)\maprotocol.o$(LOCOBJ)\GPRScomms.o: $(LOCSRC)\GPRScomms.c @echo Compiling...GPRScomms.c @$(GCC) $(LOCSRC)\GPRScomms.c -o $(LOCOBJ)\GPRScomms.o$(LOCOBJ)\POSConvert.o: $(LOCSRC)\POSConvert.c @echo Compiling...POSConvert.c @$(GCC) $(LOCSRC)\POSConvert.c -o $(LOCOBJ)\POSConvert.o$(LOCOBJ)\debug.o: $(LOCSRC)\debug.c @echo Compiling...debug.c @$(GCC) $(LOCSRC)\debug.c -o $(LOCOBJ)\debug.oclean: del obj\*.o# del *.db# del *.blk# del *.db2# del *.out</pre>
最佳答案
进入Visual Studio中的编译错误时,应使用sed -u -f GCCErrFix.sed。
调用nmake时使用的sed文件在Header之后复制了起始块,并引发错误。删除重复项可以解决此问题。
关于c - 调试Visual Studio C项目的NMake文件,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/23548877/