ASG
IBM
Zystems
Cressida
Icon
Netflexity
 
  MQSeries.net
Search  Search       Tech Exchange      Education      Certifications      Library      Info Center      SupportPacs      LinkedIn  Search  Search                                                                   FAQ  FAQ   Usergroups  Usergroups
 
Register  ::  Log in Log in to check your private messages
 
RSS Feed - WebSphere MQ Support RSS Feed - Message Broker Support

MQSeries.net Forum Index » General IBM MQ Support » â€˜MQCD’ was not declared in this scope

Post new topic  Reply to topic
 â€˜MQCD’ was not declared in this scope « View previous topic :: View next topic » 
Author Message
yasaboy
PostPosted: Mon Jul 14, 2014 1:43 am    Post subject: ‘MQCD’ was not declared in this scope Reply with quote

Voyager

Joined: 23 Jun 2014
Posts: 90

Hi,

I have been testing the MQCB functionality using a local QueueManager up to now. So I never set any channel or host parameters within my code. However now when I try to add

Code:
MQCD    ClientConn = {MQCD_CLIENT_CONN_DEFAULT}; /* Client connection channel */


it gives me the following error.

Code:
MQCallBackQueue.cpp:65: error: ‘MQCD’ was not declared in this scope
MQCallBackQueue.cpp:65: error: expected ‘;’ before ‘ClientConn’



my full code is as below.

Code:
MQCNO cno = {MQCNO_DEFAULT};
   cno.Options = MQCNO_HANDLE_SHARE_BLOCK ;

   strcpy(QMgrName,QMgrName);
   MQCONNX(QMgrName, &cno ,&Hcon, &CompCode, &CReason);
   newConnObj = false;
   
   // Open Queues 
   MQOD     od = {MQOD_DEFAULT};
   O_options = MQOO_INPUT_AS_Q_DEF|MQOO_FAIL_IF_QUIESCING;
   MOD_EXIT:

   strcpy(od.ObjectName, Qname.c_str());
   MQOPEN(Hcon, &od, O_options, &Hobj, &OpenCode, &Reason);   

   if (OpenCode == MQCC_FAILED)
   {
      printf("MQOPEN of '%.48s' ended with reason code %d for connection handle 0\n",
         od.ObjectName,Reason);
      goto MOD_EXIT;
   }   

   //Callback
   MQMD     md = {MQMD_DEFAULT};   
   MQGMO   gmo = {MQGMO_DEFAULT};   
   MQCBD   cbd = {MQCBD_DEFAULT};

   cbd.CallbackFunction = (void*)MessageConsumer2;
   cbd.CallbackArea = (void*)this;
   gmo.Options = MQGMO_NO_SYNCPOINT;

   MQCB(Hcon, MQOP_REGISTER, &cbd, Hobj, &md, &gmo, &CompCode, &Reason);
   if (CompCode == MQCC_FAILED)
   {
      printf("MQCB ended with reason code %d for connection handle 0\n", Reason);
      goto MOD_EXIT;
   }

   /////
   MQCTLO ctlo = {MQCTLO_DEFAULT};
   MQCTL(Hcon, MQOP_START, &ctlo, &CompCode, &Reason);
   if (CompCode == MQCC_FAILED)
   {
      printf("MQCTL ended with reason code %d\n", Reason);
      goto MOD_EXIT;
   }



Please help me with this error. Thanks
Back to top
View user's profile Send private message
yasaboy
PostPosted: Mon Jul 14, 2014 1:55 am    Post subject: Reply with quote

Voyager

Joined: 23 Jun 2014
Posts: 90

Really sorry.

Found the reason you really have to include

Code:
#include <cmqxc.h> /* Channel defs */ 


together with

Code:

#include <cmqc.h> /* includes for MQI  */


and it works fine afterwords
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic  Reply to topic Page 1 of 1

MQSeries.net Forum Index » General IBM MQ Support » â€˜MQCD’ was not declared in this scope
Jump to:  



You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
Protected by Anti-Spam ACP
 
 


Theme by Dustin Baccetti
Powered by phpBB © 2001, 2002 phpBB Group

Copyright © MQSeries.net. All rights reserved.