问题
# gnsdk C# wrapper sample makefile
##
CC=Csc.exe
CP=cp
GNSDK_LIB_PATH=../../../../lib/$(GNSDK_PLATFORM)
GNSDK_WRAPPER_LIB_PATH=../../lib/$(GNSDK_PLATFORM)
GNSDK_MARSHAL_LIB=$(GNSDK_WRAPPER_LIB_PATH)/gnsdk_csharp_marshal.dll
GNSDK_CSHARP_LIB=../../lib/gnsdk_csharp.dll
CSHARP_FLAGS=/noconfig /nowarn:1701,1702 /nostdlib+ /errorendlocation
CSHARP_REFS=/reference:$(GNSDK_CSHARP_LIB) /reference:"Microsoft.CSharp.dll" /reference:"mscorlib.dll" /reference:"System.Core.dll" /reference:"System.Data.DataSetExtensions.dll" /reference:"System.Data.dll" /reference:"System.dll" /reference:"System.Xml.dll"
ifeq ($(GNSDK_PLATFORM), win_x86-32)
CSHARP_FLAGS+=/platform:x86
endif
ifeq ($(GNSDK_PLATFORM), win_x86-64)
CSHARP_FLAGS+=/platform:x64
endif
SAMPLE_TARGET=sample.exe
build_sample:
$(CC) $(CSHARP_FLAGS) $(CSHARP_REFS) /out:$(SAMPLE_TARGET) /target:exe /utf8output MusicIDStream.cs
$(CP) $(GNSDK_MARSHAL_LIB) .
$(CP) $(GNSDK_CSHARP_LIB) .
I got a makefile for a c# application. I am trying to run it from visual studio command prompt. I got error with this row: CSHARP_FLAGS+=/platform:x86
回答1:
The makefile you are looking at appears to be a GNU make makefile. You cannot use it with nmake. You'll have to install GNU make if you want to use this makefile, or else write an nmake makefile to use with nmake.
回答2:
The separator missing refers to the fact that nmake is missing a colon between a target and its dependents.
In this case this is caused by the use of the GNU make ifeq, which NMAKE doesn't recognize and interprets as a target. Use the if-clause of NMAKE.
So replace your if-clauses with the following:
!if "$(GNSDK_PLATFORM)" == "win_x86-32"
CSHARP_FLAGS+=/platform:x86
!endif
!if "$(GNSDK_PLATFORM)" == "win_x86-64"
CSHARP_FLAGS+=/platform:x64
!endif
Note the ! mark before the if and endif clause and also the lack of additional line spaces. These are important.
来源:https://stackoverflow.com/questions/38466527/nmake-fatal-error-u1034-syntax-error-separator-missing