Skip to content

Commit ca1b067

Browse files
committed
clients/Makefile.am: do not LDADD libnutclient.la to libnutclientstub.la, we use them both in ultimate test program linking
This reverts commit c5b34c7 "tests/Makefile.am: do not LDADD libnutclient.la where we (also) use libnutclientstub.la": (on Linux) without the "extra" link we get CXXLD cppunittest /usr/bin/ld: cppunittest-nutclienttest.o: undefined reference to symbol '_ZTIN3nut12NutExceptionE' /usr/bin/ld: /home/runner/work/nut/nut/clients/.libs/libnutclient.so.2: error adding symbols: DSO missing from command line clang: error: linker command failed with exit code 1 (use -v to see invocation) Signed-off-by: Jim Klimov <jimklimov+nut@gmail.com>
1 parent 5f8c84f commit ca1b067

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

clients/Makefile.am

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -163,7 +163,7 @@ if HAVE_CXX11
163163
# libnutclientstub version information and build
164164
libnutclientstub_la_SOURCES = nutclientmem.h nutclientmem.cpp
165165
libnutclientstub_la_LDFLAGS = -version-info 1:1:0
166-
libnutclientstub_la_LIBADD = libnutclient.la
166+
#libnutclientstub_la_LIBADD = libnutclient.la
167167
if HAVE_WINDOWS
168168
# Many versions of MingW seem to fail to build non-static DLL without this
169169
libnutclientstub_la_LDFLAGS += -no-undefined

tests/Makefile.am

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -145,11 +145,11 @@ TESTS += $(TESTS_CXX11)
145145
# Note: we only build it, but do not run directly (NIT prepares the sandbox)
146146
check_PROGRAMS += cppnit
147147

148-
# NOTE: libnutclientstub includes libnutclient and adds nutclientmem
149148
cppunittest_CXXFLAGS = $(AM_CXXFLAGS) $(CPPUNIT_CFLAGS) $(CPPUNIT_CXXFLAGS) $(CPPUNIT_NUT_CXXFLAGS) $(CXXFLAGS)
150149
###cppunittest_CXXFLAGS += -I$(top_srcdir)/include -DTOP_SRCDIR="\"$(top_srcdir)\""
151150
cppunittest_LDFLAGS = $(CPPUNIT_LDFLAGS) $(CPPUNIT_LIBS)
152-
cppunittest_LDADD = $(top_builddir)/clients/libnutclientstub.la
151+
cppunittest_LDADD = $(top_builddir)/clients/libnutclient.la
152+
cppunittest_LDADD += $(top_builddir)/clients/libnutclientstub.la
153153
cppunittest_SOURCES = $(CPPUNITTESTSRC) $(CPPUNITTESTERSRC)
154154

155155
# Currently nutconf and related codebase causes woes for static analysis
@@ -161,7 +161,7 @@ endif WITH_NUTCONF
161161

162162
cppnit_CXXFLAGS = $(AM_CXXFLAGS) $(CPPUNIT_CFLAGS) $(CPPUNIT_CXXFLAGS) $(CPPUNIT_NUT_CXXFLAGS) $(CXXFLAGS)
163163
cppnit_LDFLAGS = $(CPPUNIT_LDFLAGS) $(CPPUNIT_LIBS)
164-
cppnit_LDADD = $(top_builddir)/clients/libnutclientstub.la
164+
cppnit_LDADD = $(top_builddir)/clients/libnutclient.la $(top_builddir)/clients/libnutclientstub.la
165165
cppnit_SOURCES = $(CPPCLIENTTESTSRC) $(CPPUNITTESTERSRC)
166166

167167
# Make sure out-of-dir C++ dependencies exist (especially when dev-building

0 commit comments

Comments
 (0)