elixir-image/image

ld: in '/usr/local/lib/libtiff.5.dylib', building for macOS-arm64 but attempting to link with file built for macOS-x86_64

Closed this issue · 1 comments

Summary:

Hi, I'm getting an error when compiling vix, it seems to be a problem with the paths, but I'm not sure.

Environment:

$ elixir --version
Erlang/OTP 25 [erts-13.0] [source] [64-bit] [smp:10:10] [ds:10:10:10] [async-threads:1] [jit]

Elixir 1.14.0 (compiled with Erlang/OTP 23)

Mac OS X Monterrey 12.4
Chip M1

$ pkg-config vips --libs
-L/opt/homebrew/Cellar/vips/8.13.3/lib -L/opt/homebrew/Cellar/glib/2.74.0/lib -L/opt/homebrew/opt/gettext/lib -lvips -lgio-2.0 -lgobject-2.0 -lglib-2.0 -lintl

Using:

{:image, "~> 0.13.1"}

Steps to reproduce:

$ brew install libvips
$ vips --version
vips-8.13.3

$ mix deps.clean vix
$ mix deps.get
$ mix compile

Error:

==> vix
cc /Users/yamildiazaguirre/Repos/classic/classicdotcom-frontend-phoenix/deps/vix/c_src/pipe.o /Users/yamildiazaguirre/Repos/classic/classicdotcom-frontend-phoenix/deps/vix/c_src/vix.o /Users/yamildiazaguirre/Repos/classic/classicdotcom-frontend-phoenix/deps/vix/c_src/vips_image.o /Users/yamildiazaguirre/Repos/classic/classicdotcom-frontend-phoenix/deps/vix/c_src/utils.o /Users/yamildiazaguirre/Repos/classic/classicdotcom-frontend-phoenix/deps/vix/c_src/vips_interpolate.o /Users/yamildiazaguirre/Repos/classic/classicdotcom-frontend-phoenix/deps/vix/c_src/vips_foreign.o /Users/yamildiazaguirre/Repos/classic/classicdotcom-frontend-phoenix/deps/vix/c_src/g_object/g_value.o /Users/yamildiazaguirre/Repos/classic/classicdotcom-frontend-phoenix/deps/vix/c_src/g_object/g_boxed.o /Users/yamildiazaguirre/Repos/classic/classicdotcom-frontend-phoenix/deps/vix/c_src/g_object/g_param_spec.o /Users/yamildiazaguirre/Repos/classic/classicdotcom-frontend-phoenix/deps/vix/c_src/g_object/g_object.o /Users/yamildiazaguirre/Repos/classic/classicdotcom-frontend-phoenix/deps/vix/c_src/g_object/g_type.o /Users/yamildiazaguirre/Repos/classic/classicdotcom-frontend-phoenix/deps/vix/c_src/vips_boxed.o /Users/yamildiazaguirre/Repos/classic/classicdotcom-frontend-phoenix/deps/vix/c_src/vips_operation.o -flat_namespace -undefined suppress -shared -L /Users/yamildiazaguirre/.asdf/installs/erlang/25.0/usr/lib `pkg-config vips --libs` -o /Users/yamildiazaguirre/Repos/classic/classicdotcom-frontend-phoenix/deps/vix/c_src/../priv/vix.so
ld: in '/usr/local/lib/libtiff.5.dylib', building for macOS-arm64 but attempting to link with file built for macOS-x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make[1]: *** [/Users/yamildiazaguirre/Repos/classic/classicdotcom-frontend-phoenix/deps/vix/c_src/../priv/vix.so] Error 1
make: *** [all] Error 2
could not compile dependency :vix, "mix compile" failed. Errors may have been logged above. You can recompile this dependency with "mix deps.compile vix", update it with "mix deps.update vix" or clean it with "mix deps.clean vix"
==> classic_frontend
** (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 solved it by removing those files:

/usr/local/lib/libpng16.16.dylib
/usr/local/lib/libtiff.5.dylib