Possible Duplicate:
Linker error on Linux: “undefined reference to”
I link together a shared library like this:
core : $(CORE_OBJS) | bin
$(CC) $(LFLAGS) -o bin/libcbitcoin$(LIBRARY_EXTENSION) $(CORE_OBJS)
Which produces the library file libcbitcoin.2.0.so.
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:
$(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) $< -o $@
This gives the linker option -lcbitcoin.2.0
.
I only get this problem when I try to build for Linux Mint and not OSX. The full makefile is here: https://github.com/MatthewLM/cbitcoin/blob/newNetworkCode/Makefile.in
The autoconf file is here (if in any case it is important): https://github.com/MatthewLM/cbitcoin/blob/newNetworkCode/configure.ac
Thanks for any help.