How to compile gcc with static library?
<p>I have static library <code>lib.a</code> and in all tutorials using:</p>

<pre><code>gcc -o main main.o -L. -lib
</code></pre>

<p>But I cant, I have errors:</p>

<pre><code>    /usr/bin/ld: cannot find -lib
collect2: error: ld returned 1 exit status
</code></pre>

<p>I need to use:</p>

<pre><code>gcc -o main main.o -L. -lib.a
</code></pre>

<p>Why? What should I do to repair it ?</p>