question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Variables in supplied ".target" file seems undefined leading to compilation error

See original GitHub issue

Description

I have the following issue :

2>------ Rebuild All started: Project: <project>, Configuration: Release x64 ------
2>		"\"  -o "Lexer.fs" --unicode Lexer.fsl
2>		'"\"' n'est pas reconnu en tant que commande interne
2>		ou externe, un programme exécutable ou un fichier de commandes.
2><projectdir>\packages\FsLexYacc.10.2.0\build\fsyacc\netcoreapp3.1\FsLexYacc.targets(36,3): error MSB3073: The command ""\"  -o "Lexer.fs" --unicode Lexer.fsl" exited with code 9009.

(I replaced my project name and directory with <> in the copied text above) (the text in french translate to :“…is not recognized as an internal or external command, executable program, or batch file.”)

For the first part of the command to be “\”, I suspect some variables in the file “FsLexYacc.targets” gets undefined (path and exec I guess), which seems to lead to faulty command.

I had been using the library without any problems up to date, this problem came when I migrated from version 10.0 to 10.2 of FsLexYacc.

The project is built with Visual Studio 2019, and the framework is “.NET Framework 4.6.1”.

Known workarounds

None known.

Related information

  • Operating system : Windows
  • .NET Runtime : .NET Framework 4.6.1

Thanks in advance !

Issue Analytics

  • State:open
  • Created 3 years ago
  • Comments:6 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
lkluccommented, Jan 14, 2021

It seems it worked correctly when using the provided “dotnet build” command. However my project was still not compiling from Visual Studio interface. I managed to get it work by adding these properties in the “fsproj” file :

  <PropertyGroup>
    <OutputType>Library</OutputType>
    <FsLexToolPath>..\packages\FsLexYacc.10.2.0\build\fslex\netcoreapp3.1</FsLexToolPath>
    <FsYaccToolPath>..\packages\FsLexYacc.10.2.0\build\fsyacc\netcoreapp3.1</FsYaccToolPath>
    <FsLexToolExe>fslex.dll</FsLexToolExe>
    <FsYaccToolExe>fsyacc.dll</FsYaccToolExe>
    <FsLexYaccToolRunner>dotnet </FsLexYaccToolRunner>
  </PropertyGroup>

I believe the NuGet package for 10.2.0 is not working correctly with .NET Standard 2.0 projects, maybe the problems lies in the configuration in the supplied “targets” file? …as if those variables where undefined, or the “targets” files does not get found by the VS build system… ?

0reactions
dsymecommented, Jan 14, 2021

Yes, though it may be failing with hidden diagnostics for whatever reasons. May be try dotnet build -v:d and check logs carefully. If it still fails maybe try to invoke fslex directly from the command line.

Read more comments on GitHub >

github_iconTop Results From Across the Web

DBT TOOL: Runtime Error Compilation Error Could not ...
1 Answer. Looks like your SF_ACCOUNT environment variable isn't set and you have to configure it before.
Read more >
Why does the compiler give an 'undefined reference' error ...
Basically… You have to make sure that the compiler knows the type of the variable and possibly that it is not defined locally...
Read more >
detecting an undefined variable
The problem is that $scale may be not defined because it is not declared. The code above causes a compile time error. The...
Read more >
Fixing Compilation Errors
Compilation errors are marked with four asterisks ( **** ) in the compilation output of the GAMS listing file (also called output file...
Read more >
SIMPL+ and CCI_JsonLib: Unable to get past compilation ...
SIMPL+ and CCI_JsonLib: Unable to get past compilation error: "Undefined Variable: 'REGISTERDELEGATE'". So, I've been building a whole bunch ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found