I've been trying to use the autotools to compile a static library. The lib itself compiles and installs OK, but I'm having trouble with the example programs. These programs must be linked with the lib to compile. I keep getting 'undefined reference' errors when I try to compile them, even if the library has already been built.
Makefile.am: ## Process this file with automake to produce Makefile.in AM_CXXFLAGS = -D_REENTRANT -Wall AM_LDFLAGS = -pthread -ldconn -lz lib_LIBRARIES = libdconn.a libdconn_a_SOURCES = DyConnect.cpp \ libdconn/DasyneInterface.cpp \ ... libdconn/sync/SyncClient.cpp \ libdconn/sync/SyncServerFSM.cpp nobase_include_HEADERS = DyConnect.h \ libdconn/DasyneInterface.hpp \ ... libdconn/sync/SyncEngine.hpp \ libdconn/sync/SyncServerFSM.hpp noinst_PROGRAMS = udpclient udpclient_SOURCES = examples/udpclient.cpp My example program is udpclient. How would I link udpclient to libdconn.a, and how would I make sure that udpclient isn't built before libdconn.a? -- View this message in context: http://www.nabble.com/Build-a-lib%2C-then-example-programs-tf4239518.html#a12063405 Sent from the Gnu - Automake - General mailing list archive at Nabble.com.