设置 Flex(词法分析器)时遇到困难
我希望将 Flex 用于大学模块,但是在我的家用计算机上设置它时遇到一些问题。
我从http://gnuwin32.sourceforge.net/packages/flex 下载了安装文件。 htm
我运行了安装程序
然后我尝试从命令中使用 flex行,导航到包含 .l (Lex) 文件的目录并输入
flex -ooutputfile.yy.c inputfile.l
(这会导致消息“'flex' 未被识别为内部文件”)或外部命令、可操作程序或批处理文件。")我记得我的导师告诉我们使用 Visual Studio 2008 命令行,所以我从 Dreamspark 下载并安装了它。
我尝试执行上述操作,但是是从 Visual Studio 2008 命令行执行的。结果是同样的消息。
您认为此错误的可能原因是缺少 .dll 文件,还是我缺少其他内容?
有什么好的、简单的方法来获取这些 .dll 文件?
谢谢。
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.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
消息
告诉你你的 shell 环境找不到 flex。该环境依赖于其 PATH 变量来获取要搜索的目录列表。您可以
使用
flex安装的完全限定路径名
,即编辑
c:\path\to\flexinstall\flex .exe -ooutputfile.yy.c inputfile.l
将flex安装路径添加到您的Windows 路径。 ControlPanel->System-AdvancedSettings-SystemPropertiesDialogBox->EnvironmentVariablesButton。
我希望这有帮助。
The message
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.