| Customize Help

Compiling and linking



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 45: 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 and MIL-Lite library files for the Microsoft Windows 7/10 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.

milcom.lib

Industrial Communication module library.

milfpga.lib

FPGA module library.

milim.lib

Image Processing module library (only some functionality is supported in MIL-Lite).

mil3d.lib

Core 3D library.

The following is a list of MIL library files for the Microsoft Windows 7/10 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.

milbead.lib

Bead module library.

milblob.lib

Blob Analysis module library.

milcal.lib

Camera Calibration module library.

milclass.lib

Classification module library.

milcode.lib

Code module library.

milcolor.lib

Color Analysis module library.

mildmr.lib

SureDotOCR 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.

mil3dim.lib

3D image processing module library.

mil3dmap.lib

3D Reconstruction module library.

mil3dmet.lib

3D Metrology module library.

mil3dreg.lib

3D Registration module library.

The following is a list of MIL and MIL-Lite 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.

libmilcom.so

Industrial Communication module library.

libmilfpga.so

FPGA module library.

libmilim.so

Image Processing module library (only some functionality is supported in MIL-Lite).

libmil3d.so

Core 3D 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.

libmilbead.so

Bead module library.

libmilblob.so

Blob Analysis module library.

libmilcal.so

Camera Calibration module library.

libmilclass.so

Classification module library.

libmilcode.so

Code module library.

libmilcolor.so

Color Analysis module library.

libmildmr.so

SureDotOCR 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.

libmil3dim.so

3D image processing module library.

libmil3dmap.so

3D Reconstruction module library.

libmil3dmet.so

3D Metrology module library.

libmil3dreg.so

3D Registration module library.

Under Windows, you will generally not need to recompile your MIL applications after installing a new release, or update to, MIL X. Consult the whatsnew release notes to check for any exceptions to this general rule. Under Linux, you must always recompile your application after installing a new release of MIL X.

Compiler warnings for deprecated constants and functions

If you recompile a MIL application that uses deprecated constants and functions, compiler warnings will typically be generated. Deprecated constants and functions should no longer be used since they could be removed in a future release, or update to, MIL. 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 release, or update to, 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 45: Using MIL with .NET.