ex_termbox icon indicating copy to clipboard operation
ex_termbox copied to clipboard

Build fails [Windows 10]

Open FatigueDev opened this issue 2 years ago • 3 comments

Specs:

  • Erlang/OTP 24 [erts-12.0] [source] [64-bit] [smp:16:16] [ds:16:16:10] [async-threads:1] [jit]
  • Elixir 1.12.3 (compiled with Erlang/OTP 22)

Reproduction Steps:

  • Create a new empty project. mix new whatever_you_like.
  • Add {:ex_termbox, "~> 1.0"} to your dependencies (mix.exs)
  • Run mix deps.get
  • Run mix

Expected output: Success

Actual output:

==> ex_termbox

Microsoft (R) Program Maintenance Utility Version 14.00.24245.0
Copyright (C) Microsoft Corporation.  All rights reserved.

NMAKE : fatal error U1052: file 'Makefile.win' not found
Stop.
could not compile dependency :ex_termbox, "mix compile" failed. You can recompile this dependency with "mix deps.compile ex_termbox", update it with "mix deps.update ex_termbox" or clean it with "mix deps.clean ex_termbox"
==> terminal_game
** (Mix) Could not compile with "nmake" (exit status: 2).
One option is to install a recent version of
[Visual C++ Build Tools](https://visualstudio.microsoft.com/visual-cpp-build-tools/)
either manually or using [Chocolatey](https://chocolatey.org/) -
`choco install VisualCppBuildTools`.

After installing Visual C++ Build Tools, look in the "Program Files (x86)"
directory and search for "Microsoft Visual Studio". Note down the full path
of the folder with the highest version number. Open the "run" command and
type in the following command (make sure that the path and version number
are correct):

    cmd /K "C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\vcvarsall.bat" amd64

This should open up a command prompt with the necessary environment variables
set, and from which you will be able to run the "mix compile", "mix deps.compile",
and "mix test" commands.

FatigueDev avatar Oct 15 '21 21:10 FatigueDev

Important to note that I have installed the Visual C++ Build Tools. I just really want to know if this is an issue that can be replicated because I've not run into it in Elixir before; other packages install no problem and I'd love to get my hands on Ratatouille to tinker.

FatigueDev avatar Oct 15 '21 21:10 FatigueDev

Hmm, I've never actually tested this on Windows. I think there may be some obstacles to getting the library working there. Support in termbox seems unclear (https://github.com/nsf/termbox/issues/65).

The build here seems to be failing pretty early on—from what I can tell elixir_make is invoking make via nmake, and that's looking for a Makefile.win (which I haven't defined).

Could you try building in the Linux sub system or a Linux VM?

I think a Windows-friendly backend for Ratatouille would be a good long-term solution.

ndreynolds avatar Oct 17 '21 02:10 ndreynolds

Confirmed to function on Windows Subsystem for Linux. Running Ubuntu latest.

Requirements (I had to apt-get these):

  • gcc
  • make
  • python
  • build-essential
  • erlang-dev

Once those are installed, you don't seem to run into any issues with compiling termbox. I'm unsure how to proceed with actually porting this to windows however, since a lot of this tooling just doesn't function or has issues on Windows.

FatigueDev avatar Oct 17 '21 06:10 FatigueDev