This is the mail archive of the mailing list for the Cygwin project.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: Mingw32 / GCC 2.95.2 bug?

On Thu, 13 Jan 2000, Joost Kraaijeveld wrote:

> I have this little program that does not work on MingW32 with the CRT or
> MSVC runtime. It works on two other compiler (IBM Visual Age and
> Microsoft VC 6.0).
> I think that it is the fault of the compiler. Can anyone look onto this?
> One can download the example at , follow the link
> bugs???.
> To install the example: create a directory, unzip the file, type make.
> To run it without error: type "ALibTest 1 0", to run it with error: type
> "ALibTest 1 1". This is the simplest case. The are more complex examples
> depending on the parameters (one can figure that out in Main.cpp). For
> the IBM and MS environment, project files are included.

You missed -mthreads when linking (which is crucial as I had pointed out
to you via email). Please try and then see if it still crashes. After 
adding -mthreads to LFLAGS, I don't see a crash for either `1 0' or `1 1' 
on the command line.  To use C++ EH and memory allocation in a thread
safe manner, you must both compile and link with -mthreads option. When
you compile, it defines _MT, and STL uses that to allocate with locks;
when you link, it links in a special DLL that does the per-thread cleanup
of exception objects.

btw, you should really move this to the Mingw list, since it really has 
nothing to do with Cygwin, but rather an issue with how Mingw supports
thread-safe C++ runtime, especially C++ EH (Cygwin does not yet support
thread-safe C++ runtime, but it'll happen in the near future once I find
some free time).


Want to unsubscribe from this list?
Send a message to

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]