delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2017/01/28/23:23:18

X-Recipient: archive-cygwin AT delorie DOT com
DomainKey-Signature: a=rsa-sha1; c=nofws; d=sourceware.org; h=list-id
:list-unsubscribe:list-subscribe:list-archive:list-post
:list-help:sender:subject:references:to:from:reply-to:message-id
:date:mime-version:in-reply-to:content-type
:content-transfer-encoding; q=dns; s=default; b=v2YkCG5poRQ9AY+p
8qfz8gvLlJ9TzS9dl+dBLway3F0/f2ET0gnqkJvD0tYrUWQpPxHJ7/BTzx1QLaMu
bMN7l3/VWaVd+MX+TlBsGgk8E6KAZn6KTvJ6mQ85T9b3S2JOHB83JJKP1sOAZVmN
e7rZtz90sBVvtmWWdIjfI2eEmsg=
DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=sourceware.org; h=list-id
:list-unsubscribe:list-subscribe:list-archive:list-post
:list-help:sender:subject:references:to:from:reply-to:message-id
:date:mime-version:in-reply-to:content-type
:content-transfer-encoding; s=default; bh=ESSe9EMONiZYZXy7xGWwFu
puqgk=; b=WvjBW/8MZmWKjopVipukL+/nfxDfdgdq2C3Hbbvd/ZvMWlbhnBhReZ
/xyaDSwIZy2r3CEVzF3vKhvpRNefA4ANu3AhdV5U5CmURQV/nlaTYlqylyRxoa76
HSnyqpxq8UoIx1WR+jyczVPByi6SvbCxQKtPGGqfqPlMKRQNTdvBs=
Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Id: <cygwin.cygwin.com>
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sourceware.org/ml/#faqs>
Sender: cygwin-owner AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com
Delivered-To: mailing list cygwin AT cygwin DOT com
Authentication-Results: sourceware.org; auth=none
X-Virus-Found: No
X-Spam-SWARE-Status: No, score=4.7 required=5.0 tests=AWL,BAYES_50,BODY_8BITS,GARBLED_BODY,KAM_LAZY_DOMAIN_SECURITY,RCVD_IN_DNSWL_LOW autolearn=no version=3.3.2 spammy=Hx-spam-relays-external:64.59.134.9, H*RU:64.59.134.9, satnatantas AT gmail DOT com, sk:satnata
X-HELO: smtp-out-no.shaw.ca
X-Authority-Analysis: v=2.2 cv=BNTDlBYG c=1 sm=1 tr=0 a=WqCeCkldcEjBO3QZneQsCg==:117 a=WqCeCkldcEjBO3QZneQsCg==:17 a=IkcTkHD0fZMA:10 a=pGLkceISAAAA:8 a=fGO4tVQLAAAA:8 a=_jxP_HfsCKwkXN_ClFMA:9 a=QEXdDO2ut3YA:10 a=6kGIvZw6iX1k4Y-7sg4_:22 a=lhOh31jNlvCVFaAdFuvQ:22
Subject: Re: I cannot understand popen/_popen absence
References: <CA+Ni7jMptR4522KzUKomR1SreADo49ptHyyufyBOCMtC78MpsQ AT mail DOT gmail DOT com> <CA+Ni7jN7-U4TgcyEnY7LMYmrmCz8moNAXhUg0RxnLhEQfTTm2Q AT mail DOT gmail DOT com>
To: cygwin AT cygwin DOT com
From: Brian Inglis <Brian DOT Inglis AT SystematicSw DOT ab DOT ca>
Reply-To: Brian DOT Inglis AT SystematicSw DOT ab DOT ca
Message-ID: <988279a5-bed3-5cec-50c2-81c909ece426@SystematicSw.ab.ca>
Date: Sat, 28 Jan 2017 21:22:51 -0700
User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:45.0) Gecko/20100101 Thunderbird/45.7.0
MIME-Version: 1.0
In-Reply-To: <CA+Ni7jN7-U4TgcyEnY7LMYmrmCz8moNAXhUg0RxnLhEQfTTm2Q@mail.gmail.com>
X-CMAE-Envelope: MS4wfIPVjVa9s13+6/afOowiqSZTjgJo2FatTNENOlLwWqO8xUZ4AJC6aEiM9cnnz5tk4TwSWgIevVlaKspcSWtZgBGLjatzMzx3u7n37eOMn0AoRwDV6xZ5 OAGpBwzveiMmtqwiVupDf7qWkRw9gsscB5slX1NXLhPbtvVL/ti/b4aJHbWXav83J1gceKlCML0PtQ==
X-IsSubscribed: yes
Note-from-DJ: This may be spam

On 2017-01-28 18:16, Пётр Б. wrote:
> Excuse me for vague wording, let me explain it.
> I am trying to build Qt under Cygwin. For some mysterious reason 
> Cygwin compiler does not expose popen with std=c++11 which is
> required for Qt
> BUT
> at the same time the MinGW compiler installed from Cygwin repository 
> does expose popen with same standard flag.
> I did not yet find a convenient way of using MinGW compiler (which
> is prefixed) so I am stuggling to get popen exposed.
> What is the reason for this difference between MinGW and Cygwin?

Different default options selected during build.

> 2017-01-29 3:50 GMT+03:00, Пётр Б. <satnatantas AT gmail DOT com>:
>> tchar.h: http://pastebin.com/raw/109n342z
>> So I only get popen if _POSIX_ is defined (which is not defined in
>> any header, I searched Cygwin folder with file manager).
>> stdio.h: http://pastebin.com/raw/jrd2dmzP
>> So I only get popen if some conditions which I did not hear about
>> are fullfilled. So, what sorcery should I use to get popen?

$ fgrep popen -C2 /usr/include/stdio.h
#if __MISC_VISIBLE || __POSIX_VISIBLE >= 199209
int     _EXFUN(pclose, (FILE *));
FILE *  _EXFUN(popen, (const char *, const char *));
#endif

$ egrep -B1 '#define\s+__(MISC_VISIBLE\s+1|POSIX_VISIBLE\s+199209)' /usr/include/sys/features.h  
#ifdef _DEFAULT_SOURCE
#define __MISC_VISIBLE          1
--
#elif (_POSIX_C_SOURCE - 0) >= 2 || defined(_XOPEN_SOURCE)
#define __POSIX_VISIBLE         199209

So you have to #define _DEFAULT_SOURCE 1, _XOPEN_SOURCE 1, or 
_POSIX_C_SOURCE 2: some of these may be enabled by using 
-std=gnu++1[14yz] instead of -std=c++...; 
roughly speaking the latter enables only ISO/IEC 9899:yyyy 
standard features and disables POSIX-only features, which 
are enabled by using -std=gnu++...

-- 
Take care. Thanks, Brian Inglis, Calgary, Alberta, Canada

--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019