How to run exixical Elixir project on Windows 8.1

I am creating escript and everything seems to be fine, but I cannot call the generated escript executable.

> mix 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, operative 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 you are running on. Check your computer system and then check with the software publisher.

Message field:

Unsupported 16-bit application

The program or function "\ ?? \ C: \ Git \ elixir \ cmdlineutil \ cmdlineutil.exe" cannot be launched or launched due to incompatibility with 64-bit versions of Windows. Check with your software vendor to find out if a non-64-bit version is available that is compatible with Windows.

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

      

+3


source to share


1 answer


Creates an escript command installed with Erlang.



> escript cmdlineutil

+10


source







All Articles