Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Antlr4 C# build error

Tags:

c#

antlr

antlr4

I am trying to install Antlr4 on a new machine but I am getting the following build error:

C:\antlrtest\antlrtest\Reference\Antlr4\Antlr4.targets(129,5): error AC1000: Unknown build error: Object reference not set to an instance of an object.

This is the offending code:

<Antlr4ClassGenerationTask
  ToolPath="$(Antlr4ToolLocation)"
  BuildTaskPath="$(Antlr4BuildTaskLocation)"
  OutputPath="$(IntermediateOutputPath)"
  TargetLanguage="%(Antlr4.TargetLanguage)"
  TargetFrameworkVersion="$(TargetFrameworkVersion)"
  TargetNamespace="%(Antlr4.CustomToolNamespace)"
  SourceCodeFiles="@(Antlr4)"
  ContinueOnError="$(_IntellisenseOnlyCompile)"
  TokensFiles="@(Antlr4Tokens)"
  AbstractGrammarFiles="@(Antlr4AbstractGrammar)"
  LanguageSourceExtensions="$(DefaultLanguageSourceExtension)"
  GenerateListener="%(Antlr4.Listener)"
  GenerateVisitor="%(Antlr4.Visitor)"
  ForceAtn="%(Antlr4.ForceAtn)"
  AbstractGrammar="%(Antlr4.Abstract)">

  <Output ItemName="Antlr4GeneratedCodeFiles" TaskParameter="GeneratedCodeFiles" />
</Antlr4ClassGenerationTask>

I think I followed the correct procedure:

I installed the extension from the VS 2012 website for Antlr. Then I edited the project file to point to the References. Then I added a reference to the Runtime DLL.

Any help would be appreciated.

like image 986
Neil Pittman Avatar asked Dec 20 '25 16:12

Neil Pittman


1 Answers

So I ran into this today and was pulling my hair out over it for quite some time. The solution for me was to install both the 32-bit and 64-bit versions of the Java SDK.

Initially I only had the 64-bit version installed. It immediately started working after I installed the 32-bit as well.

Hope that helps someone.

like image 122
womp Avatar answered Dec 23 '25 08:12

womp



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!