I am trying to use IBM WebSphere MQ "c" code (sample follows).

The header file "cmqc.h" is located in c:\mq\tools\c\include",
and the "librariy" file correponding to "cmqc.h" header is "mqm.lib" (server) or "mqic32.lib" (client),
located at "c:\mq\tools\lib" and also "c:\mq\tools\lib64"

Can someone provide me the syntax for compiling from command line ?

The CMD file I have until now is

===
c:\"Program Files (x86)"\Dev-Cpp\MinGW64\bin\gcc prova.c
-I"c:\mq\tools\c\include"
-L"c:\mq\tools\Lib\mqm.lib"
-o prova.exe

Thanks. Sebastian.

pd.- my code :

===
// fix for MinGW

ifndef _int64

define _int64 long long

endif

include < stdio.h >

include < stdlib.h >

include < string.h >

include < cmqc.h >

MQCHAR QMName [49] = "" ; / default QMgr name /

int main ( int argc, char ** argv )
{
printf ( ">>> MQCONN(). QMN [%s].\n", QMgrName ) ;

MQCONN ( QMgrName, / queue manager /
& Hcon, / connection handle /
& CompCode, / completion code /
& CReason ) ; / reason code /

}

Error : MQM.LIB is not found (or not correct format ...)

C:\Users\IBM_AD~1\AppData\Local\Temp\ccWKJ3ia.o:amqsecha.c:(.text+0x381): undefined reference to `MQCONN'

 

Last edit: Sebastia Altemir 2013-12-24