title: Linker error on Linux: "undefined reference to"
body: <p>I am able to make a shared library without problems. I create libcbitcoin.so (with no errors) and attempt to link against it with an executable as well as OpenSSL libraries. I use this command:</p>
  
  <pre><code>gcc -L/media/sf_BitEagle_Projects/cbitcoin/build/bin -lcbitcoin \
  -Wl-rpath,/media/sf_BitEagle_Projects/cbitcoin/build/bin -lssl -lcrypto \
  -L/usr/local/ssl/lib/ -o /media/sf_BitEagle_Projects/cbitcoin/build/bin/testCBAddress \
  /media/sf_BitEagle_Projects/cbitcoin/build/obj/testCBAddress.o \
  /media/sf_BitEagle_Projects/cbitcoin/build/obj/CBOpenSSLCrypto.o
  </code></pre>
  
  <p>The bin directory is the location of the library. The obj directory has the object files I wish to link into an executable. In the command I use the -L, -l and -rpath options which I thought was all that is needed for linking in linux. It seems I am wrong since I get errors like:</p>
  
  <pre><code>/media/sf_BitEagle_Projects/cbitcoin/test/testCBAddress.c:40:
  undefined reference to `CBNewByteArrayFromString'
  </code></pre>
  
  <p>CBNewByteArrayFromString is found in the library. For some reason it is not being linked. OpenSSL too:</p>
  
  <pre><code>/media/sf_BitEagle_Projects/cbitcoin/dependencies/crypto/CBOpenSSLCrypto.c:37:
  undefined reference to `SHA1'
  </code></pre>
  
  <p>How do I get the linking to work?</p>
  
  <p>GCC version: gcc (Ubuntu/Linaro 4.6.3-1ubuntu5) 4.6.3</p>
  
  <p>On Linux Mint 13</p>
  
  <p>Thank you.</p>