.

Project / Makefile Settings: Symbol Definitions

MPI_DECL1/MPI_DECL2 | MPI_ASSERT | MPI_PLATFORM

This section describes compile-time symbol definitions used by the MPI library.

MPI_DECL1 / MPI_DECL2

These symbols are used in library header files to handle compiler-specific language extensions when declaring external functions and data; in particular, those extensions used when making Win32 dynamic link libraries (DLLs). MPI_DECL1 precedes the return type of a function declaration; MPI_DECL2 follows the return type and precedes the function name:

MPI_DECL1 long MPI_DECL2 mpiModuleFunction();

Use the following symbol definitions when building an application or the MPI library.

Platform
MPI_DECL1
MPI_DECL2
Windows __declspec(dllimport) __stdcall
VxWorks extern <empty>†
Linux extern <empty>†

† <empty> indicates that MPI_DECL1 or MPI_DECL2 should be defined, but not be defined as a macro. This is equivalent to placing one of the following lines in your code:
#define MPI_DECL1
#define MPI_DECL2

MPI_ASSERT

When defined, MPI_ASSERT will cause calls to the macro mpiASSERT(expression) to be compiled into the library. Otherwise, these calls will be discarded by the preprocessor.

The mpiAssert(...) macro is used by the library and is available to applications. It is a valuable debugging tool that can be used to catch programming errors at their source and prevent them from spreading. If the argument to the macro is TRUE (i.e. non-zero), execution proceeds normally. Otherwise, an error message is displayed; the message contains the name of the file and the line number of the mpiAssert(...) call. The application exits after displaying the message.

The MPI_ASSERT define is also required for the msgCHECK(...) macro to work. msgCHECK(...) is use throughout the sample applications and utilities.

MPI_PLATFORM

The MPI_PLATFORM symbols are used to indicate the platform for which the library and applications are built. Each platform has its own unique symbol.

Standard platform define:

MPI_PLATFORM_WINNT Microsoft Windows NT/2000/XP

Supported platforms, requires platform specific release (contact Kollmorgen for availability):

MPI_PLATFORM_WINRTSS Ardence WinNT RealTime SubSystem
MPI_PLATFORM_VXWORKS WindRiver Systems VxWorks
MPI_PLATFORM_LINUX Linux
MPI_PLATFORM_SOLARIS Sun Solaris Operating System
MPI_PLATFORM_UITRON The Real-time Operating system Nucleus

Reserved for future use:

MPI_PLATFORM_WINCE Windows CE

Legacy platforms (no longer supported):

MPI_PLATFORM_WIN95 Microsoft Windows 95
MPI_PLATFORM_LYNXOS Real-Time Systems LynxOS
MPI_PLATFORM_QNX Quantum Software Systems

Note: Existence of an MPI_PLATFORM symbol for a potentially supported platform does not imply intent to support that platform.

Project Settings - Microsoft Visual Studio 2005

The MPI distribution includes a solution file for Visual Studio 2005, MDK.sln. It contains several projects, demonstrating how to build example MPI applications and utility programs. The following project settings are used to build MPI-Win32 applications. You can use these project settings to build your own MPI applications. The project settings are also viewable in VisualStudio from the Property Manager.

Common Properties -> User Macros
•     MpiLibraryName: mpivc80 or mpivc80d
•     ConfigurationDir: Debug or Release
•     MdkRootDir: base directory for MDK
•     LibDir: MPI\lib\Win32\VS2005\Debug or Release (location of MPI and apputil library)
•     ExecutableDir: Win32\Debug or Win32 (optional, specifies where to put the .exe)

C/C++ -> General -> Additional Include Directories
•     $(MdkRootDir)\MPI\include
•     $(MdkRootDir)\MPI\apputil (if apputil.lib library is used)

C/C++ -> Preprocessor -> Preprocessor Definitions
•     MPI_DECL1=__declspec(dllimport); MPI_DECL2=__stdcall; WIN32; MPI_PLATFORM_WIN32<
      MPI_ASSERT;MPI_NO_DEPRECATIONS (optional)

C/C++ -> Code Generation - > Runtime Library
•     Multi-threaded DLL (/MD) or Multi-threaded Debug DLL (/MDd)

C/C++ -> Code Generation -> Struct Member Alignment
•     8 Bytes (/Zp8) or Default

Linker -> General -> Additional Library Dependencies
•     $(MdkRootDir)\$(LibDir)\$(ConfigurationDir)

Linker -> Input -> Additional Dependencies
•     apputil.lib (optional)
•     mpiAppLib.lib
•     $(MpiLibraryName).lib

       Legal Notice  |  Tech Email  |  Feedback
      
Copyright ©
2001-2010 Motion Engineering