 <p>The cause of the problem is twofold:</p> <ol> <li>In your module you have a behaviour declaration <code>-behaviour(cowboy_http_handler).</code>. This is perfectly correct.</li> <li>When you compile the file the compiler can't find the <code>cowboy_http_handler</code> module in its search path</li> </ol> <p>This causes the error as the behaviour declaration tells the compiler to go out and find that module and find out which callback functions the behaviour expects. Normally if the compiler can't find the behaviour module, or if it can find and there are some callbacks missing then it issues a warning about this and just continues. However your Makefile sets a compiler option which treats all warnings as errors so the compilation fails.</p> <p>There are (at least) three solutions to this:</p> <ol> <li>Remove the compiler option and accept you get a warning.</li> <li>Make sure the compiler can find the behaviour module and do the checking. A simple way of doing is to add a <code>-pa Dir</code> option for the cowboy beam file directory so it can find the file.</li> <li>Set up Erlang so that it automatically finds the cowboy directory, for example with <code>$ERL_LIBS</code>.</li> </ol> <p>Note that even if the compiler finds the right module you still have to make sure that when you run the system Erlang can find the directory. There is no automatic equivalence between the compile-time and run-time environments.</p>