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 » linking error while running one of the sample sources of MQ

Post new topic  Reply to topic
 linking error while running one of the sample sources of MQ « View previous topic :: View next topic » 
Author Message
sayan
PostPosted: Tue Mar 04, 2008 7:51 am    Post subject: linking error while running one of the sample sources of MQ Reply with quote

Novice

Joined: 22 Feb 2008
Posts: 13

Hi,

I am trying to use one of the sample C sources "amqsput0.c". I have installed both client and server in windows and using microsoft visual studio as IDE. The source is compiling without errors but it gives me the following errors while linking. Pls help

mqtest.obj : error LNK2001: unresolved external symbol _MQDISC
mqtest.obj : error LNK2001: unresolved external symbol _MQCLOSE
mqtest.obj : error LNK2001: unresolved external symbol _MQPUT
mqtest.obj : error LNK2001: unresolved external symbol _MQOPEN
mqtest.obj : error LNK2001: unresolved external symbol _MQCONN
Debug/mqtest.exe : fatal error LNK1120: 5 unresolved externals
Error executing link.exe.

mqtest.exe - 6 error(s), 0 warning(s)
Back to top
View user's profile Send private message
Vitor
PostPosted: Tue Mar 04, 2008 7:58 am    Post subject: Re: linking error while running one of the sample sources of Reply with quote

Grand High Poobah

Joined: 11 Nov 2005
Posts: 26093
Location: Texas, USA

sayan wrote:
microsoft visual studio as IDE. The source is compiling without errors


You've failed to include any of the MQ libraries in the link path. You need either the client or server libraries but not both (well you can have both but only one will work).

This is not a WMQ problem but Programming 101!
_________________
Honesty is the best policy.
Insanity is the best defence.
Back to top
View user's profile Send private message
bower5932
PostPosted: Tue Mar 04, 2008 8:06 am    Post subject: Reply with quote

Jedi Knight

Joined: 27 Aug 2001
Posts: 3023
Location: Dallas, TX, USA

The Application Programming Guide will give you the information on the necessary libraries.
Back to top
View user's profile Send private message Send e-mail Visit poster's website AIM Address Yahoo Messenger
vennela
PostPosted: Tue Mar 04, 2008 1:13 pm    Post subject: Reply with quote

Jedi Knight

Joined: 11 Aug 2002
Posts: 4055
Location: Hyderabad, India

There is also a compiled and ready executable of this file. Just in case if you don't know about it. It should be in /usr/mqm/samp/bin or /opt/mqm/samp/bin depending on your platform
Back to top
View user's profile Send private message Send e-mail Visit poster's website
sayan
PostPosted: Wed Mar 05, 2008 12:06 am    Post subject: MQCONN ended with reason code 2058 Reply with quote

Novice

Joined: 22 Feb 2008
Posts: 13

Hi,

When i run amqsput.exe, the whole process runs fine. I tried to copy the source and creeate a executavle of my own. It always says "MQCONN ended with reason code 2058".

Any ideas on the probable reasons?
Back to top
View user's profile Send private message
Vitor
PostPosted: Wed Mar 05, 2008 2:01 am    Post subject: Re: MQCONN ended with reason code 2058 Reply with quote

Grand High Poobah

Joined: 11 Nov 2005
Posts: 26093
Location: Texas, USA

sayan wrote:
It always says "MQCONN ended with reason code 2058".


Assuming you're not spelling the queue manager name wrong, you're linking the wrong library, i.e. a client lib with no client config or a sever lib on a machine with no queue manager.

Either way, it can't find a queue manager name entry where it's looking & this triggers a 2058.
_________________
Honesty is the best policy.
Insanity is the best defence.
Back to top
View user's profile Send private message
sayan
PostPosted: Wed Mar 05, 2008 3:36 am    Post subject: Reason code 2058 Reply with quote

Novice

Joined: 22 Feb 2008
Posts: 13

Currently I am linking the library mqic32.Lib in the path C:\Program Files\IBM\WebSphere MQ\Tools\Lib.

After linking this i was not facing that linking error i had mentioned in the previous posts.

Is there any other library files which need to be added/linked or is there any way to find which library was used by the amqsput.exe because that is able to connect to the queue manager and put messages in the queue.
Back to top
View user's profile Send private message
Vitor
PostPosted: Wed Mar 05, 2008 3:43 am    Post subject: Re: Reason code 2058 Reply with quote

Grand High Poobah

Joined: 11 Nov 2005
Posts: 26093
Location: Texas, USA

sayan wrote:
Currently I am linking the library mqic32.Lib in the path C:\Program Files\IBM\WebSphere MQ\Tools\Lib.

After linking this i was not facing that linking error i had mentioned in the previous posts.


No, you wouldn't, and if you knew anything about the link process you'd realise why.

It doesn't mean these are the right ones for your situation. I suspect not because I don't think you've got client set up.

sayan wrote:
Is there any other library files which need to be added/linked


You've been told in this post what the libraries are, and the documentation explaining everything you need to know to achieve this.

sayan wrote:
is there any way to find which library was used by the amqsput.exe because that is able to connect to the queue manager and put messages in the queue


If you look at the documentation for the sample code, you'll see that amqsput.exe is the server version, while amqsputc.exe is the client version.

This is all very basic stuff.
_________________
Honesty is the best policy.
Insanity is the best defence.
Back to top
View user's profile Send private message
sayan
PostPosted: Thu Mar 06, 2008 3:28 am    Post subject: Printing values in MQMD structure Reply with quote

Novice

Joined: 22 Feb 2008
Posts: 13

My next problem:

I am trying to print the value ReplyToQMgr field of MQMD structure after issuing a MQGET call.

I am using this statement just to display the value
memcpy(ReplyToQmgr,mdget.ReplyToQMgr,MQ_Q_MGR_NAME_LENGTH);
LogTrace(ReplyToQmgr);

LogTrace actually prints the value into a log file. The value I am getting is as
"QM_blrkec66513e OMING"
The name of our queue manager is QM_blrkec66513e.

Could anyone explain the possible reasons? Any other way we can copy the queue manager name into a variable?

Thnx a ton in advance
Back to top
View user's profile Send private message
markt
PostPosted: Thu Mar 06, 2008 4:34 am    Post subject: Reply with quote

Knight

Joined: 14 May 2002
Posts: 508

Sounds like you need to go on a class for beginners to C programming. To repeat someone earlier in this thread:

Quote:
This is not a WMQ problem but Programming 101!
Back to top
View user's profile Send private message
sayan
PostPosted: Thu Mar 06, 2008 4:44 am    Post subject: Reply with quote

Novice

Joined: 22 Feb 2008
Posts: 13

Pls provide an answer if you have one. Posting such comments dosen't help much.

My exact requirement is to get the ReplyToQMgr field in MQMD structure.
Back to top
View user's profile Send private message
jefflowrey
PostPosted: Thu Mar 06, 2008 4:50 am    Post subject: Reply with quote

Grand Poobah

Joined: 16 Oct 2002
Posts: 19981

Being lazy and ungracious is not a good way to ask other people for help.

You don't know C programming well enough to do what you're trying to do.

Maybe there's another programming language that you *do* know, that will be easier for you to get started with.

Maybe there are programs that are already built that will do what you need to do.

Maybe you should look for them.
_________________
I am *not* the model of the modern major general.
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 » linking error while running one of the sample sources of MQ
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.