converting from -mno-cygwin

Wed Apr 27 00:32:00 GMT 2016

On 4/27/2016 05:08, Lee wrote:
> Questions:
> How to tell if I should be using libwinpthread or pthread?  I had no
> idea so installed both:
> /usr/i686-w64-mingw32/sys-root/mingw/bin
> $ ls -l *hread*
> -rwxr-xr-x 1 root None 47635 Apr  7 08:54 libwinpthread-1.dll
> -rwxr-xr-x 1 root None 65024 Jul  6  2013 pthreadGC2.dll

pthreadGC2 is a compatibility left over.

> If I should be using the pthread library, what's the correct library
> name to give GCC - ie. in the make file,
> PTHREAD_LIB  = ??what??

Just use -lpthread like everyone on *nix does.

> Is there a way to get the libraries included as part of the
> executable?  I'd rather not have to include libwinpthread-1.dll &
> zlib1.dll in the distribution package.

-static? ymmv.

> Is there a standard way to figure out if the compiler is gcc-v3 with
> the -mno-cygwin flag set?

No, don't do this, it'd turn into a giant hairball fast.

> I had to make a few changes to the code to get this far & I'd prefer
> to have the changes wrapped inside an #IFDEF or something.  For
> example, I just commented out the include since it conflicts with
> something
> #ifdef __MINGW32__
> /* -LR- #include "cygwin.h" */
> /* -LR- const char cygwin_h_rcs[] = CYGWIN_H_VERSION; */
> #endif
> Under cygwin 1.5, gcc -mno-cygwin  requires cygwin.h to be included.
> Using i686-w64-mingw32-gcc if cygwin.h is inculded gcc barfs with a
> conflicting definition of [i don't remember].
> It'd be nice if I could build using the old or new method without
> having to change the source code, so I'm guessing I want some kind of
> ifdef wrapper for the include??

What are you even trying to do? You shouldn't mix different runtimes.

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 801 bytes
Desc: OpenPGP digital signature
URL: <>

More information about the Cygwin mailing list