i686-pc-mingw32-gcc 4.5.2 and static linking libstdc++-6?

Ryan Johnson ryan.johnson@cs.utoronto.ca
Fri Jun 8 16:28:00 GMT 2012


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



More information about the Cygwin mailing list