+

Search Tips | Advanced Search

Rebuilding a C++ application on Linux

C++ IBM MQ MQI client and server applications on Linux must be recompiled using GNU Compiler Collection (GCC) 4.1.2, or later. Compilers older than GCC 4.1.2 are no longer supported. The C++ GCC 4.1.2 run time libraries, or later, must be installed in /usr/lib or /usr/lib64

If we are using one of the supported Linux distributions, the libraries are correctly installed; see System Requirements for IBM MQ.

The GCC 4.1.2 libraries support SSL and TLS connections from an IBM MQ MQI client. SSL and TLS use GSKit version 8, which depends on libstdc++.so.6. libstdc++.so.6 is included in GCC 4.1.2.


Before starting

  1. Check the required level of GCC for the distribution of Linux; see System Requirements for IBM MQ.
  2. If we are using SSL or TLS, also check the required level of libstdc++.so.
  3. Check whether the application requires rebuilding. Run the following command to display what version of libstdc++.so the application depends upon. If the result is less than libstdc++.so.6, we must rebuild the application.
    ldd ApplicationPath
    


The task describes the steps required to rebuild a Linux C++ IBM MQ application. For more detailed instructions about building Linux applications for IBM MQ ; see Building your procedural application on Linux


Procedure

  1. Check that the required GCC library is installed correctly.

    Run one of the following commands:

    • Check the 32 bit library on an x86 Linux system:
      ls -l /usr/lib/libstdc++.so.6
      
    • Check the 64 bit library on any other Linux system.
      ls -l /usr/lib64/libstdc++.so.6
      

  2. Check that the GCC compiler is at least at version 4.1.2

    Run the following command to display the version of GCC.

    gcc -v
    
  3. Rebuild the application

    The commands to compile and link Linux C++ applications are described in Building 32-bit applications and Building 64-bit applications


What to do next

When you deploy the Linux C++ application, ensure that the same GCC runtime library is correctly installed on the run time system.

Parent topic: Migrating IBM MQ on UNIX and Linux

Last updated: 2020-10-04