| MIL 10 User Guide
| Customize Help

Compiling and linking



See also
Availability
Available in MIL-Lite

Available in MIL

To compile a MIL application program, you must include the mil.h header file, in addition to the required standard C include files. After you have compiled your application program, you will have to link it with the appropriate libraries or import libraries for your operating system, compiler, and target board. The MIL libraries are located in the Matrox Imaging\Mil\lib directory.

If you are working with .NET, you must first reference Matrox.MatroxImaginglibrary.dll and then include the library in your code. See the Building a.NET application using MIL section of Chapter 36: Using MIL with.NET for more information.

Note that MIL functions run at a slower speed during debug mode. Therefore, once you are done debugging your application, you should compile in release mode to achieve maximum processing speed.

The following is a list of MIL library files for the Microsoft Windows XP/7/8 operating systems, which can be included in your program. Note that you must include mil.lib to compile your application program.

Microsoft Windows library files

Description

mil.lib

Core library (includes all the functionality available in MIL-Lite).

mil3dmap.lib

3D Reconstruction module library.

milbead.lib

Bead module library.

milblob.lib

Blob Analysis module library.

milcal.lib

Camera Calibration module library.

milcolor.lib

Color Analysis module library.

milcode.lib

Code module library.

miledge.lib

Edge Finder and Analysis module library.

milim.lib

Image Processing module library.

milmeas.lib

Measurement module library.

milmetrol.lib

Metrology module library.

milmod.lib

Geometric Model Finder module library.

milocr.lib

Character Recognition module library.

milpat.lib

NGC Pattern Matching module library.

milreg.lib

Registration module library.

milstr.lib

String Reader module library.

The following is a list of MIL library files for the Linux operating system, which can be included in your program. Note that you must include libmil.so to compile your application program.

Linux library files

Description

libmil.so

Core library (includes all the functionality available in MIL-Lite).

libmil3dmap.so

3D Reconstruction module library.

libmilbead.so

Bead module library.

libmilblob.so

Blob Analysis module library.

libmilcal.so

Calibration module library.

libmilcolor.so

Color Analysis module library.

libmilcode.so

Code module library.

libmiledge.so

Edge Finder and Analysis module library.

libmilim.so

Image Processing module library.

libmilmeas.so

Measurement module library.

libmilmetrol.so

Metrology module library.

libmilmod.so

Geometric Model Finder module library.

libmilocr.so

Character Recognition module library.

libmilpat.so

NGC Pattern Matching module library.

libmilreg.so

Registration module library.

libmilstr.so

String Reader module library.

Note that you need to recompile your MIL applications after upgrading to a new major release of MIL. A major release is denoted by a whole number, for example, MIL 10.0 is a major release. If it is only an upgrade to a minor release (for example, upgrading from MIL 10.0 to MIL 10.1) or after installing an update to a major release, it is usually not necessary. Consult the whatsnew release notes to check for any exceptions to this general rule.

Compiler warnings for deprecated constants and functions

If you recompile a MIL application that uses deprecated constants and functions, compiler warnings will now typically be generated. Deprecated constants and functions should no longer be used since they could be removed in a future major release of MIL (for example, MIL 11). All code that produces warnings about deprecated features should be updated to the code's current equivalent. For information on what has been deprecated, see the MIL release notes.

Deprecated constants typically require that you replace them with the current equivalent constant. For example, M_SETUP is a deprecated constant for MappAllocDefault() and is equivalent to the current M_DEFAULT constant; so all cases of MappAllocDefault() with M_SETUP must be replaced with MappAllocDefault() with M_DEFAULT. You can establish what the equivalent for a deprecated constant is by searching for it in the mil.h file or by referring to the MIL release notes.

Deprecated functions require that you replace them with either an equivalent function or a combination of an equivalent function with a specific constant. For example, MbufControlRegion() should be replaced with MbufControlArea(), while MdigLut() should be replaced with MdigControl() with M_LUT_ID. You can verify what the equivalent for a deprecated function is by referring to the MIL release notes.

When building an application in C/C++, you can disable warnings about deprecated features using the M_MIL_WARN_ON_DEPRECATED extension. To disable warnings, include the following statement before the #include <mil.h> statement in your application's code:

#define M_MIL_WARN_ON_DEPRECATED 0

Note, however, that code with deprecated features might not compile with a future major release of MIL if you disable warnings and do not replace the code with the current equivalent.

When building an application in the .NET environment, the process to disable compiler warnings is different and not specific to MIL. For more information, see the Disabling compiler warnings in .NET subsection of the Building a.NET application using MIL section of Chapter 36: Using MIL with.NET.