Difficulty setting up Flex (lexical analyser)
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
use the fully qualified pathname to your installation of
flex
, i.e.Edit
c:\path\to\flexinstall\flex .exe -ooutputfile.yy.c inputfile.l
Add the flex installation path to your Windows path. ControlPanel->System-AdvancedSettings-SystemPropertiesDialogBox->EnvironmentVariablesButton.
I hope this helps.
精彩评论