ex_termbox icon indicating copy to clipboard operation
ex_termbox copied to clipboard

Example fails to compile with Error 127

Open fireproofsocks opened this issue 2 years ago • 1 comments

I thought I would give the examples a try, but there seems to be a hitch:

❯ mix run examples/hello_world.exs
cd c_src/termbox && CFLAGS=-fPIC ./waf configure --prefix=. && ./waf
/bin/sh: ./waf: No such file or directory
make: *** [c_src/termbox/build/src/libtermbox.a] Error 127
** (Mix) Could not compile with "make" (exit status: 2).
You need to have gcc and make installed. Try running the
commands "gcc --version" and / or "make --version". If these programs
are not installed, you will be prompted to install them.

I do have gcc and make installed:

❯ gcc --version
Configured with: --prefix=/Library/Developer/CommandLineTools/usr --with-gxx-include-dir=/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/c++/4.2.1
Apple clang version 12.0.5 (clang-1205.0.22.9)
Target: x86_64-apple-darwin20.6.0
Thread model: posix
InstalledDir: /Library/Developer/CommandLineTools/usr/bin
❯ make --version
GNU Make 3.81
Copyright (C) 2006  Free Software Foundation, Inc.
This is free software; see the source for copying conditions.
There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A
PARTICULAR PURPOSE.

This program built for i386-apple-darwin11.3.0

In case it matters, here's my elixir version:

❯ elixir --version
Erlang/OTP 23 [erts-11.1.2] [source] [64-bit] [smp:8:8] [ds:8:8:10] [async-threads:1] [hipe]

Elixir 1.11.2 (compiled with Erlang/OTP 23)

I'm on Mac OS 11.6

It seems that the git clone command did not pull down any files from c_src/termbox/ -- I'm not sure what I'm looking at there (a submodule?) but in the Github UI it resolves to https://github.com/nsf/termbox/tree/0178b0123e176b9c4656177c07af832bc141b03f

fireproofsocks avatar Oct 20 '21 13:10 fireproofsocks

This repository includes submodules, so when cloning it, you must make sure you also clone the submodules.

For me running git version 2.30.1, I was able to pull down everything I needed by adding --recursive as a flag to my git clone command:

git clone --recursive [email protected]:ndreynolds/ex_termbox.git

Other versions of git may require different arguments.

fireproofsocks avatar Oct 20 '21 13:10 fireproofsocks