【问题标题】:./a.out is not recognized in window for executing lex./a.out 在执行 lex 的窗口中无法识别
【发布时间】:2018-07-06 16:40:51
【问题描述】:

我在 Windows 10 上使用 DevCpp 和 flex。要执行我的 lex 程序,我尝试使用 ./a.out,但出现以下错误。

C:\Users\Admin\Desktop>flex id1.l
C:\Users\Admin\Desktop>gcc lex.yy.c
C:\Users\Admin\Desktop>./a.out
'.' is not recognized as an internal or external command,

可运行的程序或批处理文件。

这可能是什么问题,请帮我解决这个问题。

【问题讨论】:

  • 至少windows上的/需要是一个`\`。
  • 好的...再次。您的桌面上是否存在此 a 可执行文件?
  • 不,/ 是 Windows 上完全有效的路径组件分隔符,从 DOS 3 左右开始。
  • @R.. .. 好吧,如果引用的话,比如dir "./"

标签: c windows lex dev-c++


【解决方案1】:

它创建一个文件名a.exe

C:\Users\Admin\Desktop>flex id1.l

C:\Users\Admin\Desktop>gcc lex.yy.c

C:\Users\Admin\Desktop>a

asd ase 12 4rf
  12 4

这就是我们在 windows 中执行 lex 的方式

【讨论】:

  • 更好:使用显式 -o 来命名输出程序,而不是依赖默认程序。
  • "它实际上创建了一个文件名a" a.exe
猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2021-12-11
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多