|
crashrpt
|
At this point you should have the CrashRpt source code compiled as described in Compiling CrashRpt.
To let your Visual C++ compiler and linker know about the location of CrashRpt include and lib files, do the following.
If you use Visual Studio 2005 or 2008, open menu Tools-> Options. Then in appeared dialog, select Projects and Solutions->VC++ Directories.
If you use Visual Studio 2010 or 2012, open the Property Manager window, multi-select all projects in your solution and right click the selection. In the appeared dialog, open Configuration Properties->VC++ Directories.
Finally,
Here <CRASHRPT_HOME> should be replaced with the actual path of the directory you unzipped CrashRpt distribution to.
Before you start using CrashRpt API functions in your program, do not forget to include CrashRpt.h header file in the beginning of your code:
You also need to add CrashRpt LIB file to the list of input libraries for your project. In the Solution Explorer window, right-click your project and choose Properties item from the context menu. Then open Configuration Properties->Linker->Input->Additional Dependencies and then add CrashRptXXXX.lib to the list of libraries (here XXXX should be replaced with CrashRpt version number).
It is important that you configure your project to use C runtime libraries (CRT) as Multi-threaded DLL (/MD) for Release configuration. This is the way recommended in MSDN. See the Exception Handling and CRT Linkage section for more information.
In the Solution Explorer window, right-click your project and open project Properties. Then choose Configuration Properties->C/C++->Code Generation. In the Runtime Library field, choose Multi-threaded DLL (/MD). See the figure below for example.
This should be done for all projects in your solution to share single CRT DLL.
Ensure that all modules that exist in your application use the same version of CRT. If some dependent modules were compiled using an older version of CRT, you should recompile them to ensure the single version or CRT DLL is used.
For example, assume you use Visual Studio 2008 and CRT 9.0 linked as DLL, but some dependent module in your application was compiled in Visual Studio 2005 and uses CRT 8.0 linked as DLL. In such situation a CRT error in the dependent module won't be intercepted by CrashRpt, because error handlers are installed for CRT 9.0 only.
To be able to recover the stack traces from the crash minidump, the debugger needs your application's debugging symbols (PDB files).
To enable the generation of PDB files:
Steps 1 and 2 should be performed for all projects in your solution that support program database (EXE, DLL).
The steps 1 and 2 are presented on the figures below.
We recommend turning off Frame Pointer Omission (FPO) optimization in release version configurations, as this optimization does not really give an appreciable gain, but greatly complicates the analysis of the dump: the /Oy compiler option makes using the debugger more difficult because the compiler suppresses frame pointer information. Moreover, in Visual Studio 2010 this optimization is disabled by default.
To disable the FPO optimization:
Further reading: Using CrashRpt API.
1.8.12