You should enable multi-threading from your project, by adding the relevant flag to the project settings.
The Microsoft flag, when compiling with
-MT. Therefore, be sure to add:
/MT to the Project Settings. (Add this option in ‘Project’ –> ‘Settings…’, under the ‘C/C++’ tab, ‘Category: General’, in the ‘Project Options’ box.)
For other compilers, verify that the compiler-specific multi-threading flag is used. For example, the
NOTE that the
-tWM flags are already part of the WinDriver samples and generated DriverWizard projects for MS
In addition, beginning with v6.0.0 of WinDriver, in order to use WinDriver’s thread functions (
ThreadStop() — implemented in WinDriver/src/utils.c) from a
_MT precompiler definition. This definition is also an integrated part of the WinDriver samples and generated code.
For MS Visual Studio 5.0 and above, this definition is part of the samples/generated code beginning with v6.0.0 of WinDriver; for
MS Visual Studio 4.0–6.0 and Borland C++ Builder were supported until version 11.1.0 of WinDriver.
When creating your own project or when using a version of WinDriver that doesn’t, add the definition for your IDE, you can add it to the project yourself:
In MS Visual Studio, do either of the following:
- Open the project in the MS Visual Studio IDE, select Project –> Settings … –> C/C++, and add
_MTin the Preprocessor Definitionstext box, under either the Preprocessor or General Category.
- Modify the project file (*.vcproj/*.dsp) or makefile (in
MS Visual Studio 4.0) by adding under the
# ADD CPP
- Add the
_MTprecompiler definition from within the
Borland C++ BuilderIDE:
Project –> Options … –> Directories/Conditionals –> Conditionals –> Conditional Defines
- Modify your project (*.bpr) file directly and set the
USDERDEFINESsection to the following:
(for Borland C++ Builder 5.0.0–6.00).
USERDEFINES = _MT
(for Borland C++ Builder 4.0).