title: "undefined reference to" for symbols in a shared library
body: <blockquote>
    <p><strong>Possible Duplicate:</strong><br>
    <a href="https://stackoverflow.com/questions/12272864/linker-error-on-linux-undefined-reference-to">Linker error on Linux: “undefined reference to”</a>  </p>
  </blockquote>
  
  
  
  <p>I link together a shared library like this:</p>
  
  <pre><code>core : $(CORE_OBJS) | bin
      $(CC) $(LFLAGS) -o bin/libcbitcoin$(LIBRARY_EXTENSION) $(CORE_OBJS)
  </code></pre>
  
  <p>Which produces the library file libcbitcoin.2.0.so. </p>
  
  <p>But when executables which link to the library are made the linker complains that there are undefined references to each symbol that comes up. The makefile links the executables like this:</p>
  
  <pre><code>$(TEST_BINARIES): bin/%: build/%.o
      $(CC) -lcbitcoin.$(LIBRARY_VERSION) -lpthread -lcbitcoin-crypto.$(LIBRARY_VERSION) -lcbitcoin-network.$(LIBRARY_VERSION) -lcbitcoin-file-ec.$(LIBRARY_VERSION) -lcbitcoin-storage.$(LIBRARY_VERSION) -lcbitcoin-rand.$(LIBRARY_VERSION) -L/opt/local/lib -levent_core -levent_pthreads -lcrypto -L$(BINDIR) $&lt; -o $@
  </code></pre>
  
  <p>This gives the linker option <code>-lcbitcoin.2.0</code>. </p>
  
  <p>I only get this problem when I try to build for Linux Mint and not OSX. The full makefile is here: <a href="https://github.com/MatthewLM/cbitcoin/blob/newNetworkCode/Makefile.in" rel="nofollow noreferrer">https://github.com/MatthewLM/cbitcoin/blob/newNetworkCode/Makefile.in</a></p>
  
  <p>The autoconf file is here (if in any case it is important): <a href="https://github.com/MatthewLM/cbitcoin/blob/newNetworkCode/configure.ac" rel="nofollow noreferrer">https://github.com/MatthewLM/cbitcoin/blob/newNetworkCode/configure.ac</a></p>
  
  <p>Thanks for any help.</p>