Hajto
CRC library does not compile on MacOS
My elixir project indirectly uses crc which has NIFs. They won’t compile. It look like the linked does not see the libraries.
rtp_to_hls ● rm -rf deps/ _build/ && mix deps.get && mix compile
==> crc
C checksum_xor.c
C crc_8.c
C crc_algorithm.c
C crc_model.c
C crc_nif.c
C crc_resource.c
C xnif_slice.c
LD crc_nif.so
Undefined symbols for architecture x86_64:
"_enif_alloc", referenced from:
_crc_model_load in crc_model.o
_kh_resize_crc_stubs in crc_model.o
_kh_resize_crc_models in crc_model.o
_crc_nif_debug_table_1 in crc_nif.o
"_enif_alloc_resource", referenced from:
_crc_resource_create in crc_resource.o
_crc_resource_clone in crc_resource.o
_xnif_slice_create in xnif_slice.o
_xnif_slice_create_x in xnif_slice.o
"_enif_consume_timeslice", referenced from:
_xnif_slice_trap in xnif_slice.o
"_enif_free", referenced from:
_crc_model_load in crc_model.o
_crc_model_unload in crc_model.o
_kh_resize_crc_stubs in crc_model.o
_kh_resize_crc_models in crc_model.o
_crc_nif_debug_table_1 in crc_nif.o
"_enif_get_map_size", referenced from:
_crc_init in crc_nif.o
_crc_init_map_extend in crc_nif.o
"_enif_get_map_value", referenced from:
_crc_init in crc_nif.o
_crc_init_map_extend in crc_nif.o
"_enif_get_resource", referenced from:
_crc_resource_get in crc_resource.o
_xnif_slice_trap in xnif_slice.o
"_enif_get_tuple", referenced from:
_crc_init_tuple in crc_nif.o
"_enif_get_uint", referenced from:
_crc_nif_checksum_xor_1_work in checksum_xor.o
_crc_nif_checksum_xor_1_done in checksum_xor.o
_crc_nif_crc_8_2 in crc_8.o
_crc_nif_crc_8_init_1 in crc_8.o
_crc_nif_crc_8_update_2 in crc_8.o
_crc_nif_crc_8_final_1 in crc_8.o
_crc_nif_crc_8_2_work in crc_8.o
...
"_enif_get_ulong", referenced from:
_crc_init_tuple in crc_nif.o
"_enif_inspect_binary", referenced from:
_crc_nif_checksum_xor_1 in checksum_xor.o
_crc_nif_checksum_xor_1_work in checksum_xor.o
_crc_nif_crc_8_2 in crc_8.o
_crc_nif_crc_8_update_2 in crc_8.o
_crc_nif_crc_8_2_work in crc_8.o
_crc_nif_crc_8_update_2_work in crc_8.o
"_enif_inspect_iolist_as_binary", referenced from:
_crc_nif_crc_fast_2 in crc_nif.o
_crc_nif_crc_fast_update_2 in crc_nif.o
_crc_nif_crc_slow_2 in crc_nif.o
_crc_nif_crc_slow_update_2 in crc_nif.o
_crc_nif_crc_fast_2_work in crc_nif.o
_crc_nif_crc_fast_update_2_work in crc_nif.o
_crc_nif_crc_slow_2_work in crc_nif.o
...
"_enif_is_atom", referenced from:
_crc_init in crc_nif.o
"_enif_is_map", referenced from:
_crc_init in crc_nif.o
"_enif_is_ref", referenced from:
_crc_init in crc_nif.o
"_enif_is_tuple", referenced from:
_crc_init in crc_nif.o
"_enif_keep_resource", referenced from:
_crc_resource_create in crc_resource.o
_crc_resource_clone in crc_resource.o
"_enif_make_atom", referenced from:
_crc_model_load in crc_model.o
_crc_model_list in crc_model.o
_crc_nif_make_atoms in crc_nif.o
"_enif_make_badarg", referenced from:
_crc_nif_checksum_xor_1 in checksum_xor.o
_crc_nif_checksum_xor_1_done in checksum_xor.o
_crc_nif_crc_8_2 in crc_8.o
_crc_nif_crc_8_init_1 in crc_8.o
_crc_nif_crc_8_update_2 in crc_8.o
_crc_nif_crc_8_final_1 in crc_8.o
_crc_nif_crc_8_2_done in crc_8.o
...
"_enif_make_list_from_array", referenced from:
_crc_nif_debug_table_1 in crc_nif.o
"_enif_make_map_put", referenced from:
_crc_model_list in crc_model.o
_crc_nif_crc_info_1 in crc_nif.o
"_enif_make_new_binary", referenced from:
_crc_model_list in crc_model.o
_crc_nif_crc_info_1 in crc_nif.o
"_enif_make_new_map", referenced from:
_crc_model_list in crc_model.o
_crc_nif_crc_info_1 in crc_nif.o
"_enif_make_resource", referenced from:
_crc_nif_crc_fast_2 in crc_nif.o
_crc_nif_crc_fast_init_1 in crc_nif.o
_crc_nif_crc_fast_update_2 in crc_nif.o
_crc_nif_crc_slow_2 in crc_nif.o
_crc_nif_crc_slow_init_1 in crc_nif.o
_crc_nif_crc_slow_update_2 in crc_nif.o
_xnif_slice_schedule in xnif_slice.o
...
"_enif_make_tuple", referenced from:
_crc_nif_debug_table_1 in crc_nif.o
_crc_init in crc_nif.o
_crc_init_map_extend in crc_nif.o
"_enif_make_uint", referenced from:
_crc_nif_checksum_xor_1 in checksum_xor.o
_crc_nif_checksum_xor_1_work in checksum_xor.o
_crc_nif_checksum_xor_1_done in checksum_xor.o
_crc_nif_crc_8_2 in crc_8.o
_crc_nif_crc_8_init_1 in crc_8.o
_crc_nif_crc_8_update_2 in crc_8.o
_crc_nif_crc_8_final_1 in crc_8.o
...
"_enif_make_ulong", referenced from:
_crc_nif_debug_table_1 in crc_nif.o
_crc_nif_crc_fast_2 in crc_nif.o
_crc_nif_crc_fast_final_1 in crc_nif.o
_crc_nif_crc_slow_2 in crc_nif.o
_crc_nif_crc_slow_final_1 in crc_nif.o
_crc_nif_crc_info_1 in crc_nif.o
_crc_nif_crc_residue_1 in crc_nif.o
...
"_enif_monotonic_time", referenced from:
_xnif_slice_trap in xnif_slice.o
"_enif_open_resource_type", referenced from:
_crc_resource_load in crc_resource.o
_crc_resource_upgrade in crc_resource.o
_xnif_slice_load in xnif_slice.o
_xnif_slice_upgrade in xnif_slice.o
"_enif_realloc", referenced from:
_kh_resize_crc_stubs in crc_model.o
_kh_resize_crc_models in crc_model.o
"_enif_release_resource", referenced from:
_crc_nif_crc_fast_2 in crc_nif.o
_crc_nif_crc_fast_init_1 in crc_nif.o
_crc_nif_crc_fast_update_2 in crc_nif.o
_crc_nif_crc_slow_2 in crc_nif.o
_crc_nif_crc_slow_init_1 in crc_nif.o
_crc_nif_crc_slow_update_2 in crc_nif.o
_crc_nif_crc_residue_1 in crc_nif.o
...
"_enif_schedule_nif", referenced from:
_xnif_slice_schedule in xnif_slice.o
_xnif_slice_trap in xnif_slice.o
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make: *** [/Users/hajtojakub/Projects/membrane-demo/rtp_to_hls/_build/dev/lib/crc/priv/crc_nif.so] Error 1
could not compile dependency :crc, "mix compile" failed. You can recompile this dependency with "mix deps.compile crc", update it with "mix deps.update crc" or clean it with "mix deps.clean crc"
==> membrane_demo_rtp_to_hls
** (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 proceeded to check the env:
rtp_to_hls ● 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 11.0.3 (clang-1103.0.32.62)
Target: x86_64-apple-darwin19.5.0
Thread model: posix
InstalledDir: /Library/Developer/CommandLineTools/usr/bin
rtp_to_hls ● 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
This is most likely configuration issue. I will post minimal reproducible project though
I tried using gnu gcc by aliasing it, but it does not work.
First Post!
dimitarvp
I am afraid in many such cases you are on your own – or at the mercy of the responsiveness of the author.
That being said, you could extract the C headers and source in a separate directory and duplicate the compilation / linking options (found somewhere in the Elixir dependency’s files) as a stand-alone project and try and chip away at that and/or share it on GitHub for us here to try and help.
Popular in Questions
What is the proper way to load a module from a file in to IEX?
In the python world, doing something like this pretty standard:
from ....
New
In Ruby, I can go:
User.find_by(email: "foobar@email.com").update(email: "hello@email.com")
How can I do something similar in Elixir? ...
New
I’m hoping you guys can give me some general advice and perhaps code examples if you’re feeling up to it.
I’m very interested in Elixir,...
New
Hi,
is there any work on GUI with Elixir, that is similar to Electron/Javascript? My idea is to bundle Phoenix and BEAM into a single se...
New
Hello,
I am trying to convert my lists to string without losing brackets.For start i have 3 map. They look like these
buyer = %{
id: ...
New
Hi,
I'm quite new in Elixir and I'm trying to format a string to a PEM format. I have the certificate value like MIIDBTCCAe2...... and ...
New
Hey all, just started picking up Elixir last week and am writing a scraper as a learning project.
Baby step #1 is extracting the number ...
New
I’m currently trying to understand how to join three tables using Ecto. All the examples I’ve seen use 2, so maybe I’m just missing somet...
New
I will often find my self writing things similar to:
case some_value do
nil -> something()
"" -> something()
_ -> someth...
New
I’m not a pro in using Regex and can’t figure out why the following behaviour happens, especially if we take into account the difference ...
New
Other popular topics
I have a relationship of love and hate with Elixir. Lots of things are just absolutely right, but there are some things that are kind of ...
New
Hello!
Sorry for this astonishing simple question, but I’m really stuck. I try to set up the intellij-elixir plugin, but I don’t know ho...
New
Hi, this is for people who, like me, have had some friction using .html.heex templates in VSCode.
The solution seems to be, in a hyphena...
New
I’m working on defining a simple Ecto schema for a table (in PostGres), but I don’t see where I can define a column as NOT NULL. Conside...
New
Hi. I’ve noticed that Windows Powershell has it’s own IEX command and you cannot access Elixir’s IEX due to the conflict. This isn’t a cr...
New
I have seen a lot of code which picks the first element from a list using Enum.at(0) instead of List.first. Is there a reason why people ...
New
Is there a way to get the call stack or stack trace at any point in the code? Not from exceptions, but an expression that returns how the...
New
Hi guys, i’m new in the Elixir world, and i have to say, that i love it!
i’m having some problem to understand anonymous functions with ...
New
To my knowledge, put_in, Map.update etc. all have the one limitation of not automatically creating intermediate keys when needed (for exa...
New
I have a super simple question about elixir - how would I take a file like this
foo bar baz
and output a new file that enumerates th...
New







