title: Linking Error in Sun Studio 10 under Solaris
body: <p>I wrote a test program like this:</p>
  
  <pre><code>#include &lt;sys/socket.h&gt;
  int main( void ) {
      int  sock = socket(AF_INET, SOCK_DGRAM, 0);
      return 0;
  }
  </code></pre>
  
  <p>And tried to compile it:</p>
  
  <pre><code>$ /tool/sunstudio/bin/cc test.c
  Undefined                       first referenced
   symbol                             in file
  socket                              test.o
  ld: fatal: Symbol referencing errors. No output written to a.out
  </code></pre>
  
  <p>The output is "symbol socket is not referenced".</p>
  
  <p>Kindly give me the direction so that I can resolve this.</p>