gpt4 book ai didi

windows - 如何在 Windows 8.1 上运行 Elixir 脚本

转载 作者:可可西里 更新时间:2023-11-01 13:50:58 24 4
gpt4 key购买 nike

我正在创建一个混合 escript,一切看起来都很好,但我无法调用生成的 escript 可执行文件。

>混合 escript.build

lib/cmdlineutil.ex:2: warning: variable args is unused
Compiled lib/cmdlineutil.ex
Generated cmdlineutil.app
Consolidated Access
Consolidated Collectable
Consolidated Enumerable
Consolidated Inspect
Consolidated List.Chars
Consolidated Range.Iterator
Consolidated String.Chars
Consolidated protocols written to _build/dev/consolidated
Generated escript cmdlineutil with MIX_ENV=dev

>cmdlineutil

'cmdlineutil' is not recognized as an internal or external command, operable program or batch file.

>mv cmdlineutil cmdlineutil.exe

>cmdlineutil.exe

This version of C:\Git\elixir\cmdlineutil\cmdlineutil.exe is not compatible with the version of Windows that you're running. Check your computer's system information and then contact the software publisher.

消息框:

Unsupported 16-Bit Application

The program or feature "\??\C:\Git\elixir\cmdlineutil\cmdlineutil.exe" cannot start or run due to incompatibility with 64-bit versions of Windows. Please contact the software vendor to ask if a 64-bit Windows compatible version is available.

lib\cmdlineutil.ex:

defmodule CmdLineUtil.Echo do
def main(args) do
IO.puts "Hello!"
end
end

mix.exs:

defmodule CmdLineUtil.Echo.Mixfile do
use Mix.Project

def project do
[app: :cmdlineutil,
version: "0.0.1",
elixir: "~> 1.0.0",
escript: escript,
deps: deps]
end

def escript do
[main_module: CmdLineUtil.Echo]
end

# Configuration for the OTP application
#
# Type `mix help compile.app` for more information
def application do
[applications: [:logger]]
end

# Dependencies can be Hex packages:
#
# {:mydep, "~> 0.3.0"}
#
# Or git/path repositories:
#
# {:mydep, git: "https://github.com/elixir-lang/mydep.git", tag: "0.1.0"}
#
# Type `mix help deps` for more examples and options
defp deps do
[]
end
end

最佳答案

Erlang 安装了一个 escript 命令。

>escript cmdlineutil

关于windows - 如何在 Windows 8.1 上运行 Elixir 脚本,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/26569257/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com