This is the mail archive of the cygwin@sourceware.cygnus.com 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: MSVCRT/threads


Darren Cook <darren@netschool.co.jp> wrote:

>I've installed EGCS 1.1 for i386-mingw32. My question is how do I tell the
>linker I'm using MSVCRT.DLL? I checked the FAQ and mailing list archives.
>I've included more details below. Thanks in advance for any suggestions,
>
>Darren
>
>
>I'm trying some multi-thread examples from the O'Reilly "win32
>multithreaded programming".
>
>The hello world program compiled first time, using CreateThread(). But when
>I changed it to use _beginthreadex() I get compile errors. I changed the
>example to include <process.h>. Now it works with Visual C++ 5 (once I
>remembered to tell it to use the multithreaded runtime library).
>
>But it still fails with EGCS. After reading the source for process.h I've
>added this line:
> #define __MSVCRT__ //For EGCS


Remove that line, the procedure I describe should do the equivalent for
you...

>Now it compiles but won't link. I found this in the readme file:
>
>  The default distribution links with and uses CRTDLL.DLL, which is
>
>guaranteed to be on *every* W95/NT system shipped. If there's
>  interest,
>I'll also upload the add-on to make it work with MSVCRT.DLL,
>  which is
>shipped with newer versions of W95/NT, as well as with MS
>  packages such
>as MS Explorer.


If you downloaded EGCS from Mumit's site reasonably recently (do a
gcc --version and if it reports
egcs-2.91.57 then I think you are alright) you have basically all you need
except for the proper specs file. Try replacing the specs file in (assuming
an install in D:\egcs\)

D:\egcs\lib\gcc-lib\i386-mingw32\egcs-2.91.57

with the attached specs file. Rename the old one specs.old, and rename the
attached file specs. This will link with msvcrt.dll and define __MSVCRT__
which changes things in a couple of header files.

Good luck,
Colin.

- Colin Peters - colin at fu.is.saga-u.ac.jp
- http://www.geocities.com/Tokyo/Towers/6162/index.html
- Go not to usenet for counsel, for it will say both
- 'yes' and 'no' and 'try another newsgroup'.

specs.msvcrt


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