|
RSS Feed - WebSphere MQ Support
|
RSS Feed - Message Broker Support
|
 |
|
[Compilation] WMQ - SUN OS - C++ |
« View previous topic :: View next topic » |
Author |
Message
|
Amazone |
Posted: Mon Jun 12, 2006 11:56 pm Post subject: [Compilation] WMQ - SUN OS - C++ |
|
|
Novice
Joined: 17 Oct 2005 Posts: 14
|
I've this code, and i want to compile it on a sunOs machine.
Code: |
#include <iostream>
#include <string>
#include <imqi.hpp>
using namespace std;
int main ( int argc, char * * argv ) {
ImqQueueManager mgr; // Queue manager
ImqQueue in_queue, out_queue; // Queues
ImqChannel channel; // Client connection channel
ImqMessage msg; // Data message
ImqGetMessageOptions gmo; // GET message options
ImqPutMessageOptions pmo; // PUT message options
if ( argc != 4 ) {
cout<<"Usage: mqclient1 <Queue Manager> <Queue1> <Queue2>"<<endl;
exit(0);
}
mgr.setName(argv[1]);
in_queue.setName(argv[2]);
out_queue.setName(argv[3]);
mgr.setName();
//Initialize channel values
//Warning: hard-coded values
channel.setChannelName("CHAN1");
channel.setTransportType( MQXPT_TCP );
channel.setConnectionName("10.40.60.68(1414)");
//Associate this channel with the queue manager
mgr.setChannelReference(channel);
//Connect to the queue manager
if ( !mgr.connect() ) {
cout<<"ImqQueueManager::connect failed with reason code "
<<(long)mgr.reasonCode( )<<endl;
exit( (int)mgr.reasonCode() );
}
cout<<"Connected to the queue manager "<<(char *)mgr.name()<<endl;
// Associate the queues with the queue manager.
in_queue.setConnectionReference(mgr);
out_queue.setConnectionReference(mgr);
//Set Open queue options for GET
in_queue.setOpenOptions(MQOO_INPUT_SHARED + MQOO_INQUIRE
+ MQOO_FAIL_IF_QUIESCING );
if(!in_queue.open()) {
cout<<"ImqQueue::open failed with reason code "
<<(long)in_queue.reasonCode( )<<endl;
exit( (int)in_queue.reasonCode() );
}
cout<<"Opened the queue(for GET): "<<(char *)in_queue.name()<<endl;
//Set Open queue options for PUT
out_queue.setOpenOptions(MQOO_OUTPUT + MQOO_INQUIRE
+ MQOO_FAIL_IF_QUIESCING);
if( !out_queue.open()) {
cout<<"ImqQueue::open failed with reason code "
<<(long)out_queue.reasonCode( )<<endl;
exit( (int)out_queue.reasonCode() );
}
cout<<"Opened the queue(for PUT): "<<(char *)out_queue.name()<<endl;
//Prepare to GET and PUT the message
gmo.setOptions( MQGMO_WAIT | MQGMO_FAIL_IF_QUIESCING );
gmo.setWaitInterval( MQWI_UNLIMITED );
pmo.setOptions(MQPMO_FAIL_IF_QUIESCING);
//Since we are NOT looking for a specific message,
//set the message id and the correlation id to default values
msg.setMessageId( );
msg.setCorrelationId( );
//Get a message from the queue
if( !in_queue.get(msg, gmo) ) {
cout<<"ImqQueue::get failed with reason code "
<<(long)in_queue.reasonCode( )<<endl;
exit( (int)in_queue.reasonCode() );
}
cout<<"Got the message....."<<endl;
//We are ready to PUT the message
if( !out_queue.put(msg, pmo) ) {
cout<<"ImqQueue::put failed with reason code "
<<(long)out_queue.reasonCode( )<<endl;
exit( (int)out_queue.reasonCode() );
}
cout<<"Posted the message...."<<endl;
return 0;
}
|
i try this :
Code: |
g++ -fsigned-char -I/produits/MQClient.5.3/inc -L/opt/mqm/lib -limqb23as -lmqic -limqc23as -lmqmcs -lmqmzse -lsocket -lnsl -ldl -W -Wpointer-arith -fc |
and i got this error :
Code: |
Undefined first referenced
symbol in file
ImqQue::put(ImqMsg&, ImqPmo&) /var/tmp//ccRNffg9.o
ImqChl::setTransportType(long) /var/tmp//ccRNffg9.o
ImqObj::setName(char const*) /var/tmp//ccRNffg9.o
ImqObj::setConnectionReference(ImqMgr*) /var/tmp//ccRNffg9.o
ImqErr::~ImqErr [not-in-charge]() /var/tmp//ccRNffg9.o
ImqGmo3::ImqGmo3[in-charge]() /var/tmp//ccRNffg9.o
ImqGmo3::~ImqGmo3 [in-charge]() /var/tmp//ccRNffg9.o
ImqMtr::setMessageId(unsigned char const*)/var/tmp//ccRNffg9.o
ImqMgr::setChannelReference(ImqChl&) /var/tmp//ccRNffg9.o
ImqQue::get(ImqMsg&, ImqGmo3&) /var/tmp//ccRNffg9.o
ImqStr::~ImqStr [in-charge]() /var/tmp//ccRNffg9.o
ImqChl::ImqChl[in-charge]() /var/tmp//ccRNffg9.o
ImqChl::~ImqChl [in-charge]() /var/tmp//ccRNffg9.o
ImqQue::ImqQue[in-charge]() /var/tmp//ccRNffg9.o
ImqQue::~ImqQue [in-charge]() /var/tmp//ccRNffg9.o
ImqMgr::connect() /var/tmp//ccRNffg9.o
ImqChl::setChannelName(char const*) /var/tmp//ccRNffg9.o
ImqPmo::ImqPmo[in-charge]() /var/tmp//ccRNffg9.o
typeinfo for ImqErr /var/tmp//ccRNffg9.o
ImqObj::setOpenOptions(long) /var/tmp//ccRNffg9.o
ImqObj::open() /var/tmp//ccRNffg9.o
ImqObj::name() /var/tmp//ccRNffg9.o
ImqChl::setConnectionName(char const*)/var/tmp//ccRNffg9.o
ImqMsg::ImqMsg[in-charge]() /var/tmp//ccRNffg9.o
ImqMsg::~ImqMsg [in-charge]() /var/tmp//ccRNffg9.o
ImqMgr::ImqMgr[in-charge]() /var/tmp//ccRNffg9.o
ImqMgr::~ImqMgr [in-charge]() /var/tmp//ccRNffg9.o
ImqMtr::setCorrelationId(unsigned char const*)/var/tmp//ccRNffg9.o
ld: fatal: Symbol referencing errors. No output written to wmq_connec
collect2: ld returned 1 exit status
make: *** [wmq_connec] Error 1 |
Can somebody help me ? |
|
Back to top |
|
 |
bower5932 |
Posted: Tue Jun 13, 2006 9:34 am Post subject: |
|
|
 Jedi Knight
Joined: 27 Aug 2001 Posts: 3023 Location: Dallas, TX, USA
|
|
Back to top |
|
 |
|
|
 |
|
Page 1 of 1 |
|
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
|
|
|
|