automake
[Top][All Lists]
Advanced

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

Re: MinGW and "warning: implicit declaration of function _spawnv"


From: Jeffrey Walton
Subject: Re: MinGW and "warning: implicit declaration of function _spawnv"
Date: Tue, 14 Nov 2017 16:39:32 -0500

On Tue, Nov 14, 2017 at 4:00 PM, Bob Friesenhahn
<address@hidden> wrote:
>>> Or maybe something else?
>>
>> It looks like the extra files provided by libtool are the problem. It
>> looks like the libtool folks need to add _XOPEN_SOURCE=600 to their
>> preprocessor definitions. I'm guessing they only test with a C
>> compiler, and not a C++ compiler and Newlib combination.
>
> What does spawnv have to do with _XOPEN_SOURCE?  Isn't spawnv a Microsoft
> Windows-specific function and _XOPEN_SOURCE is a Unix thing?

I think spawn is Posix, and its for systems that don't have fork.
posix_spawn and _spawn are deprecated on MS platforms. They use an ISO
C++ version called spawnl. Also see
https://docs.microsoft.com/en-us/cpp/c-runtime-library/reference/spawnl-wspawnl.

Its been my experience that when something Posix goes missing when
using Newlib the first thing to try is _XOPEN_SOURCE=500 or
_XOPEN_SOURCE=600. _XOPEN_SOURCE sets _POSIX_SOURCE and a couple of
others, like some X11 defines.

Adding _XOPEN_SOURCE=600 to flags clears the issue for me, but I
prefer not to use it. The flags are supposed to be consistent among
libraries and programs, so I have to tell users to add it too. RTFM
has not really worked in the last 50 years or so, and most people will
naturally omit it, so I would like to drop the additional requirement.

Jeff



reply via email to

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