开发者

Difficulty setting up Flex (lexical analyser)

开发者 https://www.devze.com 2023-04-10 14:32 出处:网络
I\'m looking to use Flex for a University module, however I\'m having some trouble setting it up on my home computer.

I'm looking to use Flex for a University module, however I'm having some trouble setting it up on my home computer.

  • I downloaded the Setup file from http://gnuwin32.sourceforge.net/packages/flex.htm

  • I ran Setup

  • I then tried to use flex from the Command Line, by navigating to the directory containing the .l (Lex) file and开发者_运维知识库 typing flex -ooutputfile.yy.c inputfile.l (This resulted in the message " 'flex' is not recognised as an internal or external command, operable program or batch file.")

  • I remembered that my tutor had told us to use the Visual Studio 2008 Command line, so I downloaded and installed that from Dreamspark.

  • I tried to do the above, but from the Visual Studio 2008 Command Line. The same message resulted.

  • I looked into the Installation and Usage http://gnuwin32.sourceforge.net/install.html and noticed that it said you would need msvcrt.dll (and sometimes also msvcp60.dll) and that these would be in the Windows\System folder. It also said that these would be there if you had Internet Explorer 4.0. or greater on your system. These .dll files are not there.

Do you think the likely cause of this error is the missing .dll files, or am I missing something else?

What is a good, simple way to get hold of these .dll files?

Thank you.


The message

'flex' is not recognised as an internal or external command, operable program or batch file.

is telling you that the environment of your shell can't find flex. The environment is relying on its PATH variable for a list of directories to search. You can

  1. use the fully qualified pathname to your installation of flex, i.e.

    Edit

    c:\path\to\flexinstall\flex .exe -ooutputfile.yy.c inputfile.l

  2. Add the flex installation path to your Windows path. ControlPanel->System-AdvancedSettings-SystemPropertiesDialogBox->EnvironmentVariablesButton.

I hope this helps.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号