[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Build a lib, then example programs

From: myrdos2
Subject: Build a lib, then example programs
Date: Wed, 8 Aug 2007 15:58:38 -0700 (PDT)

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.

## Process this file with automake to produce

AM_LDFLAGS = -pthread -ldconn -lz

lib_LIBRARIES = libdconn.a

libdconn_a_SOURCES = DyConnect.cpp \
        libdconn/DasyneInterface.cpp \
        libdconn/sync/SyncClient.cpp \

nobase_include_HEADERS = DyConnect.h \
        libdconn/DasyneInterface.hpp \
        libdconn/sync/SyncEngine.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:
Sent from the Gnu - Automake - General mailing list archive at

reply via email to

[Prev in Thread] Current Thread [Next in Thread]