[Top][All Lists]

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

Re: AC_CHECK_LIB failures with AC_LANG(C++)

From: Dima Pasechnik
Subject: Re: AC_CHECK_LIB failures with AC_LANG(C++)
Date: Sat, 31 Oct 2020 22:35:21 +0000
User-agent: Mutt/1.10.1 (2018-07-13)

On Sat, Oct 31, 2020 at 09:23:30PM +0200, Jani Välimaa wrote:
> Hello,
> Looks like AC_CHECK_LIB(foo, main, [foo="yes"]) calls fails after
> https://git.savannah.gnu.org/cgit/autoconf.git/commit/?id=326c9a547423d25c621bc5c0ef76edbf6eda8c92
> if AC_LANG(C++) is also used.
> Running configure fails to find libraries and config.log shows the
> following.
> conftest.cpp:38:14: error: '::main' must return 'int'
>    38 |   extern "C" void main ();
>       |              ^~~~       
> Problem disappears if I revert the commit. gcc version is 10.2.0.
looking at this commit, it appears that main() should be a special case
as it cannot be of type void, and C++ compilers are getting more and
more picky with the standard.
Actually, in modern C main() cannot be of type void either, and
the corresponding place in AC_LANG_CALL(C)  ought to be fixed in this
respect, as well.


reply via email to

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