Web lists-archives.org

[Mingw-users] Linking against MSVCR71.DLL




As I'm sure you know, Billy, etal., insists no linking against 
MSVCRT.DLL and advise MSVCR71.DLL instead.  By default, MinGW is naughty 
and wants to link against the forbidden library.

I'm using MinGW 3.4.2 built as a cross-compiler. In the .../3.4.2/specs 
file, I changed "... -lmsvcrt" to "... -lmsvcr71", and it *almost* 
works. Using a Windows ldd equivalent: http://www.dependencywalker.com/,
some clicky-fu reveals the vast majority of libraries are satisfied by 
MSVCR71, but a few are not: _strdup, _stat, _ftime and _write.

In case my libraries were stale, I rebuilt both mingw-runtime-3.10 and 
w32api-3.1 with the changed specs file, but no joy.  I've attached some 
test code that illustrates the problem.

Any help would be appreciated.

Jim Wilson
Gainesville, FL

------------- Code Follows -----------------

#include <stdio.h>      /* for stdout */
#include <unistd.h>     /* For write(...) */
#include <string.h>     /* For strdup(...) */
#include <sys/timeb.h>  /* For ftime(...) */
#include <sys/types.h>  /* For stat(...) */
#include <sys/stat.h>
#include <unistd.h>

int main(int argc, char* argv[]) {
   struct timeb foo; struct stat bar;    /* Some on-stack variables */
   char* cp = strdup("Hello world\n");   /* Call the dupe meister */
   stat(".", &bar);                      /* Call the stat meister */
   ftime(&foo);                          /* Call the time meister */
   write(fileno(stdout), cp, strlen(cp));/* Call the write meister */
}

	


-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
MinGW-users mailing list
MinGW-users@xxxxxxxxxxxxxxxxxxxxx

You may change your MinGW Account Options or unsubscribe at:
https://lists.sourceforge.net/lists/listinfo/mingw-users