public inbox for cygwin@cygwin.com
 help / color / mirror / Atom feed
* i686-pc-mingw32-gcc 4.5.2 and static linking libstdc++-6?
@ 2012-06-01 17:29 Dennis Isenhour
  2012-06-01 19:34 ` Earnie Boyd
                   ` (2 more replies)
  0 siblings, 3 replies; 7+ messages in thread
From: Dennis Isenhour @ 2012-06-01 17:29 UTC (permalink / raw)
  To: cygwin

Can someone tell me, is static linking of libstdc++(-6 ?) not
currently supported in cygwin using the mingw compiler?

On Thu, May 31, 2012 at 1:55 PM, Dennis Isenhour
<dennis.isenhour@gmail.com> wrote:
> Please excuse me if this isn’t the correct place for this question or
> if I’ve misunderstood something, or am not understanding something
> obvious, but I honestly wasn’t really sure where the best place to ask
> was despite looking around for quite some time and I have been unable
> to locate anything that directly answers my questions in any of the
> forums (on both the cygwin.com and mingw.org sites).
>
> I am in the process of switching from an older version of cygwin gcc
> where I previously used the –mno-cygwin flag in order to utilize the
> mingw compiler portion.  With the new latest version, it appears I
> need to change to explicitly install and utilize the mingw compiler.
> After making the change, I have now encountered a situation where my
> compiled executable is no longer working/loading correctly.  Debugging
> the problem using the “cygcheck” tool, I was able to determine that
> the object was failing because it could not locate “libstdc++-6.dll”.
>
> cygcheck: track_down: could not find libstdc++-6.dll
>
> I thus located ./gcc/i686-pc-mingw32/4.5.2/debug/libstdc++-6.dll and
> copied it to my local build area, which ultimately did in fact resolve
> my issue.  However, I would prefer NOT to have to distribute this dll
> with my executables and so I am thus now attempting to figure out how
> I can go about linking this new, apparently required library,
> statically, however I can’t seem to locate libstdc++-6.a or
> libstdc++-6.so anywhere in my cygwin repository.  I've been trying to
> make use of '-static-libstdc++' option, however I see that it keeps
> telling me that it is not recognized:
>
> i686-pc-mingw32-gcc: unrecognized option '-static-libstdc++'
>
> I'm also not real sure what the difference is between libstdc++-6 and
> libstdc++, so I'm not positive -static-libstdc++ would be the correct
> solution either, even if I could get that to work.
>
> Anyone who can provide me with any further insight or useful
> information would be greatly appreciated!
>
> Thanks in advance.

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

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: i686-pc-mingw32-gcc 4.5.2 and static linking libstdc++-6?
  2012-06-01 17:29 i686-pc-mingw32-gcc 4.5.2 and static linking libstdc++-6? Dennis Isenhour
@ 2012-06-01 19:34 ` Earnie Boyd
  2012-06-05 21:28   ` Linda Walsh
  2012-06-01 22:41 ` Greg Chicares
  2012-06-08 14:55 ` Dennis Isenhour
  2 siblings, 1 reply; 7+ messages in thread
From: Earnie Boyd @ 2012-06-01 19:34 UTC (permalink / raw)
  To: cygwin

On Fri, Jun 1, 2012 at 1:29 PM, Dennis Isenhour wrote:
> Can someone tell me, is static linking of libstdc++(-6 ?) not
> currently supported in cygwin using the mingw compiler?

http://cygwin.com/acronyms/#TOFU

IDK, but maybe with -static-libstdc++ it would work.

-- 
Earnie
-- https://sites.google.com/site/earnieboyd

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

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: i686-pc-mingw32-gcc 4.5.2 and static linking libstdc++-6?
  2012-06-01 17:29 i686-pc-mingw32-gcc 4.5.2 and static linking libstdc++-6? Dennis Isenhour
  2012-06-01 19:34 ` Earnie Boyd
@ 2012-06-01 22:41 ` Greg Chicares
  2012-06-08 14:55 ` Dennis Isenhour
  2 siblings, 0 replies; 7+ messages in thread
From: Greg Chicares @ 2012-06-01 22:41 UTC (permalink / raw)
  To: cygwin

On 2012-06-01 17:29Z, Dennis Isenhour wrote:
>>
>> i686-pc-mingw32-gcc: unrecognized option '-static-libstdc++'

What if you use i686-pc-mingw32-g++ instead of i686-pc-mingw32-gcc?

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

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: i686-pc-mingw32-gcc 4.5.2 and static linking libstdc++-6?
  2012-06-01 19:34 ` Earnie Boyd
@ 2012-06-05 21:28   ` Linda Walsh
  0 siblings, 0 replies; 7+ messages in thread
From: Linda Walsh @ 2012-06-05 21:28 UTC (permalink / raw)
  To: cygwin

Had to look up that acronym, and saw this one right above it:


TMTOWTDI

Oh the irony.... ;-)



Earnie Boyd wrote:
> On Fri, Jun 1, 2012 at 1:29 PM, Dennis Isenhour wrote:
>> Can someone tell me, is static linking of libstdc++(-6 ?) not
>> currently supported in cygwin using the mingw compiler?
> 
> http://cygwin.com/acronyms/#TOFU
> 
> IDK, but maybe with -static-libstdc++ it would work.
> 

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

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: i686-pc-mingw32-gcc 4.5.2 and static linking libstdc++-6?
  2012-06-01 17:29 i686-pc-mingw32-gcc 4.5.2 and static linking libstdc++-6? Dennis Isenhour
  2012-06-01 19:34 ` Earnie Boyd
  2012-06-01 22:41 ` Greg Chicares
@ 2012-06-08 14:55 ` Dennis Isenhour
  2012-06-08 16:28   ` Ryan Johnson
  2 siblings, 1 reply; 7+ messages in thread
From: Dennis Isenhour @ 2012-06-08 14:55 UTC (permalink / raw)
  To: cygwin

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

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

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: i686-pc-mingw32-gcc 4.5.2 and static linking libstdc++-6?
  2012-06-08 14:55 ` Dennis Isenhour
@ 2012-06-08 16:28   ` Ryan Johnson
  2012-06-15 21:30     ` Dennis Isenhour
  0 siblings, 1 reply; 7+ messages in thread
From: Ryan Johnson @ 2012-06-08 16:28 UTC (permalink / raw)
  To: cygwin

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

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: i686-pc-mingw32-gcc 4.5.2 and static linking libstdc++-6?
  2012-06-08 16:28   ` Ryan Johnson
@ 2012-06-15 21:30     ` Dennis Isenhour
  0 siblings, 0 replies; 7+ messages in thread
From: Dennis Isenhour @ 2012-06-15 21:30 UTC (permalink / raw)
  To: cygwin

Just to close the loop on this for anyone who might be encountering a
similar issue or situation in the future, with the simple test example
info Ryan Johnson provided me in the previous response, I was able to
eventually narrow down my problem to a makefile complexity.  The
makefile was setting the link flag '-lstdc++' at a point in the build
process AFTER it had already specified the -static-libstdc++ option,
thus overriding it.  I'm not exactly sure where/how it was switched to
make the -lstdc++ be interpeted as dynamic, but regardless it was
obviously not only redundant but overriding the earlier specified
-static option.

And while I'm being 100% thorough I should probably just re-state more
clearly that the other *separate* problem I had (which was resolved in
an earlier post), the makefile had actually been mixing g++ for some
compiles and gcc for others, but using gcc for producing the end
executable, so i switched it to just make use of g++ which obviously
resolved the "unrecognized option" issue I had mentioned I had been
seeing before.

Thanks very much for all the help, especially to Ryan.
-Dennis

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

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2012-06-15 21:30 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-06-01 17:29 i686-pc-mingw32-gcc 4.5.2 and static linking libstdc++-6? Dennis Isenhour
2012-06-01 19:34 ` Earnie Boyd
2012-06-05 21:28   ` Linda Walsh
2012-06-01 22:41 ` Greg Chicares
2012-06-08 14:55 ` Dennis Isenhour
2012-06-08 16:28   ` Ryan Johnson
2012-06-15 21:30     ` Dennis Isenhour

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).