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. |
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 . |
For Microsoft Visual C++, there are three choices:
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.
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.
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 |
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:
When using the DLL versions, you must compile your application using the multithreaded DLL runtime library. You cannot use the statically linked runtime.
When using the statically linked library versions, you must compile your application using multithreaded or multithreaded debug runtime library. You cannot use the DLL runtime libraries.
/FORCE:MULTIPLE
linker option to avoid an error message about a duplicate operator new()
symbol in debug configurations. 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.
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.
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 -lwinhttp -lws2_32 -lgdi32 -lole32
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.
If you are using MSYS2, and if you are getting mysterious compiler errors or undefined types, make sure you are using the MinGW64 toolchain shell, not the MSYS2 shell.