Author |
Message
|
sayan |
Posted: Tue Mar 04, 2008 7:51 am Post subject: linking error while running one of the sample sources of MQ |
|
|
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 |
|
 |
Vitor |
Posted: Tue Mar 04, 2008 7:58 am Post subject: Re: linking error while running one of the sample sources of |
|
|
 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 |
|
 |
bower5932 |
Posted: Tue Mar 04, 2008 8:06 am Post subject: |
|
|
 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 |
|
 |
vennela |
Posted: Tue Mar 04, 2008 1:13 pm Post subject: |
|
|
 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 |
|
 |
sayan |
Posted: Wed Mar 05, 2008 12:06 am Post subject: MQCONN ended with reason code 2058 |
|
|
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 |
|
 |
Vitor |
Posted: Wed Mar 05, 2008 2:01 am Post subject: Re: MQCONN ended with reason code 2058 |
|
|
 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 |
|
 |
sayan |
Posted: Wed Mar 05, 2008 3:36 am Post subject: Reason code 2058 |
|
|
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 |
|
 |
Vitor |
Posted: Wed Mar 05, 2008 3:43 am Post subject: Re: Reason code 2058 |
|
|
 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 |
|
 |
sayan |
Posted: Thu Mar 06, 2008 3:28 am Post subject: Printing values in MQMD structure |
|
|
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 |
|
 |
markt |
Posted: Thu Mar 06, 2008 4:34 am Post subject: |
|
|
 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 |
|
 |
sayan |
Posted: Thu Mar 06, 2008 4:44 am Post subject: |
|
|
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 |
|
 |
jefflowrey |
Posted: Thu Mar 06, 2008 4:50 am Post subject: |
|
|
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 |
|
 |
|