Matrix Science header

C++ toolkit installation on Windows
[C++ toolkit installation]

Directory structure

Directory Files Description
compiler/include msparser.hpp and a number of other include files. You only need to #include "msparser.hpp" -- this includes the other files. Make sure that this directory is on your include path.
compiler/lib msparser.lib
msparserD.lib
msparserDS.lib
msparserS.lib

msparser.dll
msparserD.dll
Mascot Parser library file; see Choosing the correct DLL file and Using the MinGW compiler.
example_cxx *.cpp
build_all.cmd
Source code for C++ examples. These can all be built from the command line using the build_all.cmd command. Make sure that the C++ compiler is on the system path when running build_all.cmd.

Using Visual C++

Windows SDK 2003 SP1 required for Visual Studio 2005

When using VS 2005, for Mascot Parser 2.5 and later, it is necessary to install Windows SDK 2003 SP1. The only required files are: winhttp.h and winhttp.lib (for 32 and 64 bit), so these files can be copied from the SDK to another location if required. There is no need to install the Windows SDK separately for later versions of the compiler.

Choosing the correct DLL file

For Microsoft Visual C++, there are three choices:

Debug or release builds.

It is normally necessary to use the debug build of Mascot Parser with a debug build of your application, and the release build for release builds of your application.

If the wrong build of msparser.dll is used, then, for example, Mascot Parser will be using the non-debug version of the Microsoft run time library, while application code will be using the debug version. Since pointers to memory are being passed between msparser and application code, they need to use the same RTL. Note however, that the debug version can be very slow with very large files.

Static or dynamically linked.

A statically linked library has the advantage that you won't need to ship any extra modules with your application. The disadvantage is increased executable size.

With a dynamically linked library, the advantage is that if there is a bug fix or an enhancement in Mascot Parser, then you would only need to ship a patched version of the msparser.dll file. The disadvantage is, of course, having to ship the file with the application.

Unicode or MBCS.
Use whichever version your application uses. However, note that Mascot only saves single byte characters in the results files, so separate unicode builds of the library are not required and will not be supplied in version 2.2 and later.

The filenames for the .lib and .dll files and the directories for the test harness are shown below:

Debug Static .lib name .dll name Directory
    msparser.lib msparser.dll Win32_Release
  X msparserS.lib n/a Win32_ReleaseS
X   msparserD.lib msparserD.dll Win32_Debug
X X msparserDS.lib n/a Win32_DebugS

Compiler Options

When compiling against the static libraries, you need to add the following definition in your source code, or add it to the project file:

#define _MATRIX_USE_STATIC_LIB 

If in doubt, check the options in the appropriate test harness.

Note the following:

Where to install msparser.dll

Mascot Parser is being used by some mass spectrometer vendors. This means that there is the possibility that another version of the DLL may be installed on the computer. To avoid any possible conflict, it is strongly recommended that you do not install this DLL in the system32 directory, but just put it in your application directory.

Compiling examples from the command line

It is possible to compile the Windows C++ examples from the command line rather than creating a project. For example, to build using the static library:

  C:\>cl -D _MATRIX_USE_STATIC_LIB /MT /EHsc -I ..\include resfile_error.cpp  
    /link ../lib/msparserS.lib ws2_32.lib advapi32.lib wininet.lib /OPT:NOREF

There is a cmd file, build_all.cmd, in the C++ examples directory that builds all the examples.

Using the MinGW compiler

The mingw/lib directory contains three files:

File Description
libmsparser.a Static library without debugging information.
msparser.dll DLL for use with applications compiled using MinGW
libmsparser_import.a Import library for use when compiling an application to be dynamically linked with msparser.dll

To compile and link one of the example programs statically:

  $ g++ -D _MATRIX_USE_STATIC_LIB  -I ../include -L ../lib  resfile_summary.cpp -lmsparser -lwininet

To compile and link one of the example programs dynamically:

  $ g++ -I ../include  -L ../lib  resfile_summary.cpp -lmsparser_import

In this case, you will need to make sure that msparser.dll is in the same directory as the .exe file or is located on the system path.

Copyright © 2016 Matrix Science Ltd.  All Rights Reserved. Generated on Fri Jun 2 2017 01:44:51