X-Recipient: archive-cygwin@delorie.com
X-SWARE-Spam-Status: No, hits=-1.7 required=5.0	tests=AWL,BAYES_00,KHOP_RCVD_UNTRUST,KHOP_THREADED,RCVD_IN_DNSWL_LOW,SPF_NEUTRAL,TW_YG,T_RP_MATCHES_RCVD
X-Spam-Check-By: sourceware.org
Message-ID: <4FD22835.1000301@cs.utoronto.ca>
Date: Fri, 08 Jun 2012 12:28:37 -0400
From: Ryan Johnson <ryan.johnson@cs.utoronto.ca>
User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:12.0) Gecko/20120428 Thunderbird/12.0.1
MIME-Version: 1.0
To: cygwin@cygwin.com
Subject: Re: i686-pc-mingw32-gcc 4.5.2 and static linking libstdc++-6?
References: <CALAJ8nR96ag_LRkQUJerzBQkXgf9YCV+P8eDid2z7FpHW3a+YQ@mail.gmail.com> <CALAJ8nTQwksEWCeG-pF-2v_XcHPOsMWj=Gqzf+6W-COVnS0A_Q@mail.gmail.com>
In-Reply-To: <CALAJ8nTQwksEWCeG-pF-2v_XcHPOsMWj=Gqzf+6W-COVnS0A_Q@mail.gmail.com>
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
X-IsSubscribed: yes
Mailing-List: contact cygwin-help@cygwin.com; run by ezmlm
List-Id: <cygwin.cygwin.com>
List-Subscribe: <mailto:cygwin-subscribe@cygwin.com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin@cygwin.com>
List-Help: <mailto:cygwin-help@cygwin.com>, <http://sourceware.org/ml/#faqs>
Sender: cygwin-owner@cygwin.com
Mail-Followup-To: cygwin@cygwin.com
Delivered-To: mailing list cygwin@cygwin.com

On 08/06/2012 10:55 AM, Dennis Isenhour wrote:
> On 2012-06-01 22:40, Greg Chicares wrote:
> What if you use i686-pc-mingw32-g++ instead of i686-pc-mingw32-gcc?
>
> I've tried that (so i'm no longer receiving the "unrecognized option"
> warning message), but I must still be doing something wrong as I'm
> still having the same problem.  It doesn't appear to actually be
> linking the library statically as cygcheck still gives me the same
> error:
>   cygcheck: track_down: could not find libstdc++-6.dll
Passing appropriate -static-* options to g++ solves it for me, though 
strangely enough I can't find the corresponding .a files either:

$ cat scratch.cpp
#include <string>
#include <iostream>
int main() {
     std::string s = "hi";
     std::cout << s << std::endl;
}

$ i686-pc-mingw32-g++ scratch.cpp && cygcheck ./a >/dev/null && ./a
cygcheck: track_down: could not find libgcc_s_dw2-1.dll
cygcheck: track_down: could not find libstdc++-6.dll

$ i686-pc-mingw32-g++ -static-libgcc -static-libstdc++ scratch.cpp && 
cygcheck ./a >/dev/null && ./a
hi

$ cygcheck -dc | grep mingw
mingw-binutils                 2.21-1
mingw-gcc-core                 4.5.2-1
mingw-gcc-g++                  4.5.2-1
mingw-pthreads                 20110507-1
mingw-runtime                  3.20-1
mingw-w32api                   3.17-2

Ryan


--
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

