简体   繁体   English

nmake致命错误U1034:语法错误:分隔符丢失

[英]nmake fatal error U1034: syntax error : separator missing

# 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 ac# application. 我得到了一个用于ac#应用程序的makefile。 I am trying to run it from visual studio command prompt. 我正在尝试从Visual Studio命令提示符运行它。 I got error with this row: CSHARP_FLAGS+=/platform:x86 我在此行出现错误:CSHARP_FLAGS + = / platform:x86

The makefile you are looking at appears to be a GNU make makefile. 您正在查看的makefile似乎是GNU make makefile。 You cannot use it with nmake. 您不能将其与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. 如果要使用此Makefile,则必须安装GNU make,否则,请编写要与nmake一起使用的nmake makefile。

The separator missing refers to the fact that nmake is missing a colon between a target and its dependents. 缺少分隔符是指nmake缺少目标及其依赖对象之间的冒号。

In this case this is caused by the use of the GNU make ifeq, which NMAKE doesn't recognize and interprets as a target. 在这种情况下,这是由于使用了NMAKE无法识别并解释为目标的GNU make ifeq引起的。 Use the if-clause of NMAKE. 使用NMAKE的if子句。

So replace your if-clauses with the following: 因此,将以下if子句替换为:

!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. 在if和endif子句之前标记,也缺少其他的行空间。 These are important. 这些很重要。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM