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 » IBM MQ API Support » Linking Error in MQ program in C on AIX

Post new topic  Reply to topic
 Linking Error in MQ program in C on AIX « View previous topic :: View next topic » 
Author Message
Harshalw
PostPosted: Tue Apr 27, 2010 1:02 am    Post subject: Linking Error in MQ program in C on AIX Reply with quote

Voyager

Joined: 23 Jul 2008
Posts: 77

Hi I have written a simple code in C for connecting to the queue manager.
It is getting compiled , however giving linking error . The error and make file content are follow

# make -f MQconn.mak
/usr/vacpp/bin/xlC_r -q64 -oMQconn.o -c MQconn.c
/usr/vacpp/bin/xlC_r -q64 -bloadmap:loadmap.out -oMQconn.exe MQconn.o
ld: 0711-317 ERROR: Undefined symbol: .MQCONN
ld: 0711-344 See the loadmap file loadmap.out for more information.
make: 1254-004 The error code from the last command is 8.
Stop.

When i check loadmap.out , it gives me
(ld): addgl /usr/lib/glink64.o
ADDGL: Glink code added for 13 symbols.
(ld): er full
ld: 0711-318 ERROR: Undefined symbols were found.
The following symbols are in error:
Symbol Inpndx TY CL Source-File(Object-File) OR Import-File{Shared-object}
RLD: Address Section Rld-type Referencing Symbol
----------------------------------------------------------------------------------------------
.MQCONN [24] ER PR MQconn.c(MQconn.o)
00000050 .text R_RBR [6] .main
ER: The return code is 8.

Below in my C file
#include <cmqc.h>
int main()
{
MQHCONN ConnH; /*Connection Handle */
MQHOBJ ObjH; /*Object Handle */

MQLONG CompCode; /* Completion code */
MQLONG Reason; /* Qualifying reason */

char QueMgr[] = "OIMDEV01";

strncpy(QMName,QueMgr,MQ_Q_MGR_NAME_LENGTH);

MQCONN(QMName,&ConnH,&CompCode,&Reason);


if(CompCode != MQCC_OK)
{
printf("\nMQCONN ended with Error cc %ld rc %ld\n", CompCode, Reason);
exit(Reason);
}

printf("\n Connected to queue manager");
}


Please le me know what can be the prolem here...
Thanks.
Back to top
View user's profile Send private message
mvic
PostPosted: Tue Apr 27, 2010 1:13 am    Post subject: Re: Linking Error in MQ program in C on AIX Reply with quote

Jedi

Joined: 09 Mar 2004
Posts: 2080

You need -lmqm or -lmqic

Look for the compile/link instructions in the MQ manual.
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 » IBM MQ API Support » Linking Error in MQ program in C on AIX
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.