delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2009/04/12/22:21:06

X-Recipient: archive-cygwin AT delorie DOT com
X-SWARE-Spam-Status: No, hits=-2.6 required=5.0 tests=BAYES_00
X-Spam-Check-By: sourceware.org
Message-ID: <49E2A17D.3040803@sbcglobal.net>
Date: Mon, 13 Apr 2009 02:20:45 +0000
From: Greg Chicares <gchicares AT sbcglobal DOT net>
User-Agent: Thunderbird 2.0.0.21 (Windows/20090302)
MIME-Version: 1.0
To: cygwin AT cygwin DOT com
Subject: Re: cygwin1.7, g++ 4.3.2 (with -std=c++0x) and undefined references to snprintf()
References: <49E27B93 DOT 8090601 AT nc DOT rr DOT com> <49E2888A DOT 5080906 AT nc DOT rr DOT com>
In-Reply-To: <49E2888A.5080906@nc.rr.com>
X-IsSubscribed: yes
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

On 2009-04-13 00:34Z, Brian and Victoria wrote:
> Brian and Victoria wrote:
>> I've exhausted my google-fu and am hoping someone on the list has 
>> superior powers...
>>
>> I'm on the bleeding edge, using cygwin 1.7 and g++ 4.3.2 with 
>> -std=c++0x (enables C++0x experimental features, and access to 
>> variadic template parameters in my case).
>>
>> Prior to switching on c++0x, there were no problems.  Afterwards 
>> though, the linker (via g++) complains about undefined references to 
>> snprintf().  I'm linking with "stdc++", and tried also linking with 
>> "c" (C99 library) as well, but no luck.  Anyone else running into this?
>>
>> I've got a build in progress with -std=gnu++0x instead (GNU dialect of 
>> the experimental C++0x features), and will see how that goes.
>
> This has resolved the problem, so something may be amiss with the 
> standard dialect or there's something forgiving about the GNU dialect.

The snprintf() family was added to C in C99. It's not in the 2003 C++
standard, but it is in N2857, the C++0x draft as of 2009-03-23. Still,
gcc's current C++0x support is experimental:
  http://gcc.gnu.org/projects/cxx0x.html
so it doesn't seem alarming that the more forgiving '-std=gnu++0x' is
needed today in this case.

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

- Raw text -


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