Hitachi

Job Management Partner 1 Version 10 Job Management Partner 1/Base Function Reference


2.2.3 Compiling the source files

To issue and acquire JP1 events, you must first compile and link the code source files.

Files needed for compiling:
  • JP1/Base header file (installed when JP1/Base is installed)

  • Source files created in C or C++ (user-created files)

The location of the header file is as follows:

Windows: installation-folder\include\JevApi.h

UNIX: /opt/jp1base/include/JevApi.h

Files needed for linking:
  • Libraries (installed when JP1/Base is installed)

Note that the required libraries vary by OS and by compiler. The following table lists the libraries required for each OS.

Table 2‒4: Libraries required for each OS

OS

Required library

Windows XP Professional

Windows Vista

Windows Server 2003

Windows Server 2008

Windows 7

Windows 8

Windows 8.1

Windows Server 2012

installation-folder\lib\libJevApiA.lib (for 32-bit multi-threaded applications)

Solaris

AIX

Linux 5 (x86)

Linux 6 (x86)

/opt/jp1base/lib/libJevApiAst.a (for 32-bit single-threaded applications)

/opt/jp1base/lib/libJevApiAmt.a (for 32-bit multi-threaded applications)

HP-UX (IPF)

/opt/jp1base/lib/libJevApiAst32.a (for 32-bit single-threaded applications)

/opt/jp1base/lib/libJevApiAmt32.a (for 32-bit multi-threaded applications)

/opt/jp1base/lib/libJevApiAst64.a (for 64-bit single-threaded applications)

/opt/jp1base/lib/libJevApiAmt64.a (for 64-bit multi-threaded applications)

The table below lists for each OS the options to specify when compiling and linking the source files.

Note:

When you compile and link source files in Visual Studio Integrated Development Environment (GUI) for Windows, use options that are appropriate for configuring the environment, from among the compile and link options listed in the tables below.

Table 2‒5: Compile options

OS

Compile option

Windows XP Professional

Windows Vista

Windows Server 2003

Windows Server 2008

Windows 7

Windows 8

Windows 8.1

Windows Server 2012

(32-bit multi-threaded)

/MD /I "installation-folder\include"

HP-UX (IPF)

(32-bit single-threaded)

-Aa# -I/opt/jp1base/include

HP-UX (IPF)

(32-bit multi-threaded)

-Aa# -mt -I/opt/jp1base/include

HP-UX (IPF)

(64-bit single-threaded)

+DD64 -Aa# -I/opt/jp1base/include

HP-UX (IPF)

(64-bit multi-threaded)

+DD64 -Aa# -mt -I/opt/jp1base/include

Solaris

(32-bit single-threaded)

-I/opt/jp1base/include

Solaris

(32-bit multi-threaded)

-mt -D_THREAD_SAFE -I/opt/jp1base/include

AIX

(32-bit single-threaded)

-I/opt/jp1base/include

AIX

(32-bit multi-threaded)

-D_REENTRANT -D_THREAD_SAFE -I/opt/jp1base/include

Linux 5 (x86)

Linux 6 (x86)

(32-bit single-threaded)

-I/opt/jp1base/include

Linux 5 (x86)

Linux 6 (x86)

(32-bit multi-threaded)

-D_REENTRANT -D_THREAD_SAFE -I/opt/jp1base/include

#: The -Aa option for HP-UX is needed only when you use the C compiler (cc) to compile. You can replace the -Aa option with the -Ae option, but do not specify the -Ac option. The -Aa option can be omitted if you use the C++ compiler (aCC).

Table 2‒6: Link options

OS

Link option

Windows XP Professional

Windows Vista

Windows Server 2003

Windows Server 2008

Windows 7

Windows 8

Windows 8.1

Windows Server 2012

(32-bit multi-threaded)

"installation-folder\lib\libJevApiA.lib"

HP-UX (IPF)

(32-bit single-threaded)

/opt/jp1base/lib/libJevApiAst32.a

HP-UX (IPF)

(32-bit multi-threaded)

-mt /opt/jp1base/lib/libJevApiAmt32.a

HP-UX (IPF)

(64-bit single-threaded)

+DD64 /opt/jp1base/lib/libJevApiAst64.a

HP-UX (IPF)

(64-bit multi-threaded)

+DD64 -mt /opt/jp1base/lib/libJevApiAmt64.a

Solaris

(32-bit single-threaded)

/opt/jp1base/lib/libJevApiAst.a -ldl

Solaris

(32-bit multi-threaded)

/opt/jp1base/lib/libJevApiAmt.a -ldl -lpthread

AIX

(32-bit single-threaded)

/opt/jp1base/lib/libJevApiAst.a -ldl

AIX

(32-bit multi-threaded)

/opt/jp1base/lib/libJevApiAmt.a -ldl -lpthread

Linux 5 (x86)

Linux 6 (x86)

(32-bit single-threaded)

/opt/jp1base/lib/libJevApiAst.a -ldl

Linux 5 (x86)

Linux 6 (x86)

(32-bit multi-threaded)

/opt/jp1base/lib/libJevApiAmt.a -ldl -lpthread

Notes:
  • The libraries provided by JP1/Base are static libraries (or an archive for UNIX). They are not DLL import libraries or shared libraries.

  • The libraries provided by JP1/Base are dynamically loaded by means of a DLL (or a shared library for UNIX) bundled with JP1/Base. This means that created programs will run on a machine on which JP1/Base is not installed, but certain functions will fail with a JEV_NO_LIBRARY error.

  • DLLs dynamically loaded from the libraries provided by JP1/Base for Windows are independent of the libraries packaged with side-by-side assembly, so no manifest is provided.

  • Do not use the -l option when linking the libraries provided by JP1/Base on UNIX.

  • When linking on UNIX, we recommend that you use the same linkage editor you used for the compiling (cc, for example), rather than using ld. If you do use ld to link the files, specify the same options in the same order as the compiler when it automatically passes to ld.

  • To compile source files in the Linux x64 environment, add -m32 to the compile options and link options.