The information in this article applies to:
SYMPTOMSA program that uses the multithread run-time library fails to run to completion or generates a Dr. Watson access-violation error message. CAUSEThis behavior can occur if the compile options are not consistent with the libraries included in linking. RESOLUTION
If the program is linked using the MSFRT.LIB and MSVCRT.LIB files, your
object modules must be compiled using the -MD option.
MORE INFORMATIONTo demonstrate the problem and workaround, compile the sample code below (TESTC), using the four different tests listed. The first two tests demonstrate the problem, while the last two tests show two sets of options that do not cause problems: Test 1The TESTC created using these options will produce a Dr. Watson error message:
Test 2The TESTC created using these options will not produce an error message, but will fail to run completely and will not produce any output:
-or-
Test 3The TESTC created using these options will create a TESTC program that is linked to MSFRT.LIB and MSVCCRT.LIB. The actual run-time code is in the DLLs MSFRT10 and MSVCRT10. This TESTC will correctly display the message, "Factorial of 7 is: 5040":
Test 4The TESTC created using these options has the run-time code statically linked into the executable file. It will also correctly display the message, "Factorial of 7 is: 5040":
-or-
C Sample Code
FORTRAN Sample Code
Additional query words: 1.00 multi-thread
Keywords : kbcode kbCompiler kbFL32 kbFortranPS |
Last Reviewed: November 4, 1999 © 2000 Microsoft Corporation. All rights reserved. Terms of Use. |