I have a program aa
that depends on libbb
which depends on libcc
.
In libb's Makefile.am I have added
libbb_la_LIBADD = -lcc
In aa's Makefile I have added
aa_LDADD = -lbb
This works wonderful in the default case.
But I needed static linking, so I ran all the configures with --disable-shared
.
Unfortunately when compiling aa
I got:
libb_source.c: undefined reference to libcc_symbol
Any ideas what is missing?
Update: Don't think of specifying dependencies like this if you are crosscompiling and using a stagingdir.
LIBADD
andLDADD
variables should listlibbb.la
rather than-lbb
. You might conditionally add-static
to theAM_LDFLAGS
variable. – Brett Hale