Sun Java System Message Queue 4.3 Developer's Guide for C Clients

Building the Basic C-Client Sample Programs

The following commands illustrate the process of building and linking the sample application Producer.c on the Solaris, Linux, AIX, and Windows platforms. The commands include the pre-processor definitions needed to support Message Queue C-API fixed-size integer types. For options used to support multithreading, please consult documentation for your compiler.

To Compile and Link on Solaris OS

CC -compat=5 -mt -DSOLARIS -I/opt/SUNWimq/include -o Producer \\
    -L/opt/SUNWimq/lib -lmqcrt Producer.c

For Solaris OS, if you need 64-bit support, you need to specify the following compiler options:

. For example, to compile and link the example application on Solaris/SPARC, you would use the following command:

CC -compat=5 -mt -xarch=v9 -DSOLARIS -I/opt/SUNWimq/include -o Producer \\
   L/opt/SUNWimq/lib/sparcv9 -lmqcrt Producer.c

To Compile and Link on Linux

g++ -DLINUX -D_REENTRANT -I/opt/sun/mq/include -o Producer \\
    -L/opt/sun/mq/lib -lmqcrt Producer.c

To Compile and Link on AIX

xlC_r -qthreaded -DAIX -I/$IMQ_HOME/include -o Producer \\
    -blibsuff:so -l$IMQ_HOME/lib -imqcrt Producer.c

To Compile and Link on Windows

cl /c /MD -DWIN32 -I%IMQ_HOME%\include Producer.c
link Producer.obj /NODEFAULTLIB msvcrt.lib \\
      /LIBPATH:%IMQ_HOME%\lib mqcrt.lib