Building 64-bit applications

This topic contains examples of the commands used to build 64-bit programs in various environments.

MQ_INSTALLATION_PATH represents the high-level directory in which IBM MQ is installed.

    C client application, 64-bit, non-threaded
    gcc -m64 -o amqsputc_64 amqsput0.c -I MQ_INSTALLATION_PATH/inc
    -L MQ_INSTALLATION_PATH/lib64
    -Wl,-rpath=MQ_INSTALLATION_PATH/lib64 -Wl,-rpath=/usr/lib64 -lmqic
    

    C client application, 64-bit, threaded
    gcc -m64 -o amqsputc_64_r amqsput0.c -I MQ_INSTALLATION_PATH/inc
    -L MQ_INSTALLATION_PATH/lib64
    -Wl,-rpath=MQ_INSTALLATION_PATH/lib64 -Wl,-rpath=/usr/lib64 -lmqic_r
    -lpthread
    

    C server application, 64-bit, non-threaded
    gcc -m64 -o amqsput_64 amqsput0.c -I MQ_INSTALLATION_PATH/inc
    -L MQ_INSTALLATION_PATH/lib64
    -Wl,-rpath=MQ_INSTALLATION_PATH/lib64 -Wl,-rpath=/usr/lib64 -lmqm
    

    C server application, 64-bit, threaded
    gcc -m64 -o amqsput_64_r amqsput0.c -I MQ_INSTALLATION_PATH/inc
    -L MQ_INSTALLATION_PATH/lib64
    -Wl,-rpath=MQ_INSTALLATION_PATH/lib64 -Wl,-rpath=/usr/lib64 -lmqm_r
    -lpthread
    

    C++ client application, 64-bit, non-threaded
    g++ -m64 -fsigned-char -o imqsputc_64 imqsput.cpp
    -I MQ_INSTALLATION_PATH/inc
    -L MQ_INSTALLATION_PATH/lib64
    -Wl,-rpath=MQ_INSTALLATION_PATH/lib64 -Wl,-rpath=/usr/lib64
    -limqc23gl -limqb23gl -lmqic
    

    C++ client application, 64-bit, threaded
    g++ -m64 -fsigned-char -o imqsputc_64_r imqsput.cpp
    -I MQ_INSTALLATION_PATH/inc
    -L MQ_INSTALLATION_PATH/lib64
    -Wl,-rpath=MQ_INSTALLATION_PATH/lib64 -Wl,-rpath=/usr/lib64
    -limqc23gl_r -limqb23gl_r -lmqic_r -lpthread
    

    C++ server application, 64-bit, non-threaded
    g++ -m64 -fsigned-char -o imqsput_64 imqsput.cpp
    -I MQ_INSTALLATION_PATH/inc
    -L MQ_INSTALLATION_PATH/lib64 -Wl,-rpath= MQ_INSTALLATION_PATH/lib64
    -Wl,-rpath=/usr/lib64 -limqs23gl -limqb23gl -lmqm
    

    C++ server application, 64-bit, threaded
    g++ -m64 -fsigned-char -o imqsput_64_r imqsput.cpp
    -I MQ_INSTALLATION_PATH/inc
    -L MQ_INSTALLATION_PATH/lib64 -Wl,-rpath= MQ_INSTALLATION_PATH/lib64
    -Wl,-rpath=/usr/lib64 -limqs23gl_r -limqb23gl_r -lmqm_r -lpthread
    

    C client exit, 64-bit, non-threaded
    gcc -m64 -shared -fPIC -o /var/mqm/exits64/cliexit_64 cliexit.c
    -I MQ_INSTALLATION_PATH/inc
    -L MQ_INSTALLATION_PATH/lib64
    -Wl,-rpath=MQ_INSTALLATION_PATH/lib64
    -Wl,-rpath=/usr/lib64 -lmqic
    

    C client exit, 64-bit, threaded
    gcc -m64 -shared -fPIC -o /var/mqm/exits64/cliexit_64_r cliexit.c
    -I MQ_INSTALLATION_PATH/inc
    -L MQ_INSTALLATION_PATH/lib64
    -Wl,-rpath=MQ_INSTALLATION_PATH/lib64
    -Wl,-rpath=/usr/lib64 -lmqic_r -lpthread
    

    C server exit, 64-bit, non-threaded
    gcc -m64 -shared -fPIC -o /var/mqm/exits64/srvexit_64 srvexit.c
    -I MQ_INSTALLATION_PATH/inc
    -L MQ_INSTALLATION_PATH/lib64
    -Wl,-rpath=MQ_INSTALLATION_PATH/lib64
    -Wl,-rpath=/usr/lib64 -lmqm
    

    C server exit, 64-bit, threaded
    gcc -m64 -shared -fPIC -o /var/mqm/exits64/srvexit_64_r srvexit.c
    -I MQ_INSTALLATION_PATH/inc
    -L MQ_INSTALLATION_PATH/lib64
    -Wl,-rpath=MQ_INSTALLATION_PATH/lib64
    -Wl,-rpath=/usr/lib64 -lmqm_r -lpthread
    

Parent topic: Preparing C programs in Linux