Compiling a static executable
<p>I am trying to compile an statically-linked executable, but I cannot seem to avoid producing a dynamically-linked one instead.  I tried this compilation command first:</p>

<pre><code>gcc -o test test.c -lcrypto -ldl -lz -static-libgcc 
</code></pre>

<p>I have also tried just <code>-static</code> and <code>--disable-shared</code> with the same results.  I thought the above command would be enough to produce a static executable, but the <code>file</code> command tells me that the result is dynamically linked.</p>

<p>Can anyone shed some light on what I am doing wrong?</p>