title: OpenSSL and Rand_bytes
body: <p>My question is in regards to using OpenSSL on Mac via GCC. </p>
  
  <pre><code>    #include &lt;stdio.h&gt;
      #include &lt;openssl/rand.h&gt;
  
      int main()
      {
       unsigned char key[128];
       Rand_bytes(key,128);
       return 0;
      }
  </code></pre>
  
  <p>I have the following code, that I am trying to compile with GCC. Here is what I enter into the command line</p>
  
  <pre><code>    gcc -o ossl ossl.c -lcrypto -lssl
  </code></pre>
  
  <p>However I get the following error. </p>
  
  <blockquote>
    <p>Undefined symbols for architecture x86_64:
     "_Rand_bytes", referenced from:
         _main in cc2hf0Ij.o
    ld: symbol(s) not found for architecture x86_64
    collect2: ld returned 1 exit status</p>
  </blockquote>
  
  <p>I am not experienced when it comes to using openssl. Why am I receiving <code>Undefined symbols for architecture x86_64</code>?</p>