title: C: compile some objects (for a shared library) without main() fails?
body: <p>From what I have learned I need to follow this step to prepare for making a shared library:</p>
  
  <pre><code>gcc -fPIC libfoo.c -o libfoo.o
  </code></pre>
  
  <p>And then I link it. I had tried making a makefile to aid in these steps, but there appears to be errors happening now.</p>
  
  <p>This occurs when I run the make file:</p>
  
  <pre><code>foo@box:~/Projects/so$ gcc -fPIC ./libfoo.c -o libfoo.o
  /usr/lib/gcc/i686-linux-gnu/4.4.5/../../../../lib/crt1.o: In function `_start':
  (.text+0x18): undefined reference to `main'
  collect2: ld returned 1 exit status
  </code></pre>
  
  <p>How can I compile the library file without the main function, as it is not a program and is intended to be a library?</p>
  
  <p>If it helps my program is basically this (interpreted)</p>
  
  <pre><code>(stdio and openssl headers here)
  
  (debugging macro definitions here)
  
  (two functions, gettime() and opensslrandom() defined here)
  </code></pre>
  
  <p>I seem to have problems understanding about the macros as well, as they would be in the shared library in the end they are useless in the shared library? I included them in libfoo.h to be included, although I have yet to see if the macros work.</p>