Subject: Libtool doesn't build correctly with multiple check library dependencies

From: Michael Cress <[email-masked]>
Date: Fri, 19 Jan 2018 01:26:36 -0600

Greetings,

I am getting a “make check” linking error ( e.g. ./.libs/library.so: undefined reference to ‘function implemented in another library within the same makefile). Libtool builds everything just fine using bin_, but when copying and pasting the _CFLAGS, _LDADD, etc., renaming to check_ and rebuilding via make check, I get the error.

Note: the referenced libraries are all Libtool .la libraries generated within a large project Makefile. Again, all libraries are building and executing just fine. The only issue is when I attempt to use make check.

Finally, if I comment out the unit test code (leaving essentially a bare bones empty unit test) and remove the LDADD references to the Libtool intermediate libraries and make check works fine (it builds, runs, and shows the Pass/Fail report).

I have done everything I can think of to make this work but I have gotten nowhere. So, I’m guessing this is a bug somewhere.

Thanks,

Michael Cress