Some Useful Resources

Find some helpful links that might strengthen your Elixir skills.

Useful GitHub links

Helpful tools


On Linux:
gcc -o priv/ -shared -fpic \ -I/usr/local/erlang/18.1/lib/erlang/erts-9.2/include \ c_src/elixir_nif.c

Remember, you’ll have to replace the -I with the path you found previously. The flags -shared and -fpic tell GCC to build a shared library with position-independent code. This means the code does not expect to be loaded into a specific memory address.

On macOS, we need to specify two extra flags and the correct path for -I, like this:
gcc -o priv/ -shared -fpic -dynamiclib \ -undefined dynamic_lookup \ -I/usr/local/Cellar/erlang/18.1/lib/erlang/erts-9.2/include \ c_src/elixir_nif.c

Remember to type the previous on one line.

And on Windows, we use this on one line:
cl /IERTS_INCLUDE_PATH=C:\erlang\18.1\lib\erlang\erts-9.2\include /LD /MD /Fe priv\ src\elixir_nif.c

Get hands-on with 1200+ tech skills courses.