Mailing-List: contact cygwin-help AT sourceware DOT cygnus DOT com; run by ezmlm List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner AT sourceware DOT cygnus DOT com Delivered-To: mailing list cygwin AT sourceware DOT cygnus DOT com X-Authentication-Warning: hp2.xraylith.wisc.edu: khan owned process doing -bs Date: Thu, 13 Jan 2000 18:51:25 -0600 (CST) From: Mumit Khan To: Joost Kraaijeveld cc: "Cygwin AT Sourceware. Cygnus. Com (E-mail)" Subject: Re: Mingw32 / GCC 2.95.2 bug? In-Reply-To: <1F8B49DD9100D31195FC00A0C94989FE0DB8@obelix> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII 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 http://www.askesis.nl , 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). Regards, Mumit -- Want to unsubscribe from this list? Send a message to cygwin-unsubscribe AT sourceware DOT cygnus DOT com