gpt4 book ai didi

c - 调试 Visual Studio C 项目的 NMake 文件

转载 作者:行者123 更新时间:2023-11-30 17:34:01 26 4
gpt4 key购买 nike

我有一个 C 项目,我正在使用 NMake 来编译该项目。但是,我遇到了错误,而且我发现很难找出导致该错误的原因。 有谁知道如何调试使用 nmake 编译的 Visual Studio C 项目,甚至知道是什么导致了下面的错误?:

输出文件

------ Rebuild All started: Project: DirectTopUp, Configuration: Debug Win32 ------

Microsoft (R) Program Maintenance Utility Version 10.00.30319.01 Copyright (C) Microsoft Corporation. All rights reserved.

del obj*.o

sed: file GCCErrFix.sed line 1: unknown command: `<'

C:\Program Files\MSBuild\Microsoft.Cpp\v4.0\Microsoft.MakeFile.Targets(43,5): error MSB3073: The command "NMAKE /f make/makefile /a 2<&1 | sed -u -f GCCErrFix.sed " exited with code 1.

========== Rebuild All: 0 succeeded, 1 failed, 0 skipped ==========

MakeFile

    path=c:\windows;c:\windows\system32;$(GCCROOT)\build\bin

#NAME = Direct-Top-Up
NAME = JOSECARD

GCCDIR = $(GCCROOT)\build
GCCBIN = $(GCCDIR)\bin
GCCLIB = $(GCCDIR)\lib
GCCLIBELF = $(GCCDIR)\libelf
GCCINC = $(GCCDIR)\include

LOCSRC = .\src
LOCOBJ = .\obj
LOCOUT = .\out
LOCINC = .\src
LOCLIB = ..\lib

JOSINCDIR = $(JOSAPIINC)
JOSLIBDIR = $(JOSAPILIB)

LIB = $(GCCLIB)\libc.a
JOSLIB = pc1000api(v21)
WLSLIB = pc1000idwlsapi(v23)

ASM = $(GCCDIR)\BIN\arm-elf-as
GCC = $(GCCDIR)\BIN\arm-elf-gcc -O3 -I$(GCCINC) -I$(JOSINCDIR) -I$(LOCINC) -mlittle-endian -mcpu=arm9 -c
LINK = $(GCCDIR)\BIN\arm-elf-ld -Tldscript -L$(GCCLIB) -L$(GCCLIBELF) -L$(JOSLIBDIR)
CCFLAG = -O3 -I..\build\include -mlittle-endian -mcpu=arm9


OBJ = $(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.o

clean:
del obj\*.o
# del *.db
# del *.blk
# del *.db2
# del *.out
</pre>

最佳答案

在 Visual Studio 中出现编译错误时,应使用 sed -u -f GCCErrFix.sed。调用 nmake 时使用的 sed 文件在 header 后面有重复的起始 block ,并引发错误。删除重复项可以解决问题。

关于c - 调试 Visual Studio C 项目的 NMake 文件,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/23548877/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com