[Top][All Lists]

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

Re: Per-Object Flags for Autotool C++ library?

From: Nick Bowler
Subject: Re: Per-Object Flags for Autotool C++ library?
Date: Fri, 3 Nov 2017 13:51:12 -0400

On 11/3/17, Jeffrey Walton <address@hidden> wrote:
> On Thu, Nov 2, 2017 at 6:04 PM, Jeffrey Walton <address@hidden> wrote:
>> I'm working on adding Autotools to a C++ library and test program. My
>> has:
>> <Nick and Mathieu's changes applied>
>> ...
> I believe I applied Nick and Mathieu correctly. The project is
> available at . It
> includes the six Git commands to duplicate the issue.
> The new issue is, the compile stops after about 4 files are compiled.
> Here's the pastebin of `make V=1`: The
> error is also shown below.
> The linker is invoked for reasons unknown to me at the moment. Most of
> the objects are missing. I even deleted the project's directory and
> re-cloned to ensure they were not old artifacts hanging around.

For whatever reason it appears that the generated makefile has missing
prerequisites for  I would expect everything listed in
LIBADD to end up as a prerequisite of the library.  This might require
some investigation to find out why that apparently did not happen in
your case.

Adding everything to EXTRA_libcryptopp_la_DEPENDENCIES might help as
a workaround, e.g.,

  EXTRA_libcryptopp_la_DEPENDENCIES = $(libcryptopp_la_LIBADD)

But this (or equivalent) should have happened automatically.

> I have no idea why a C compiler is being invoked in some places. I
> took great care to ensure Autoconf knew this was a C++ project, and
> not a C project. That's another problem I've been searching for an
> answer for.

It seems it decided to link the library using the C compiler because no
source files are specified for the library.  There may be (or should be)
a way to force it one way or the other, but an obvious workaround is to
specify at least one C++ source file in libcryptopp_la_SOURCES (could be
one of the real files or just a stub).  The _SOURCES objects will appear
earlier on the linker command line than any of the _LIBADD objects.


reply via email to

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