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 IndexIBM MQ API Support2002 is returned by MQCONN on Linux

Post new topicReply to topic
2002 is returned by MQCONN on Linux View previous topic :: View next topic
Author Message
guogangli
PostPosted: Fri Jun 16, 2017 2:20 pm Post subject: 2002 is returned by MQCONN on Linux Reply with quote

Novice

Joined: 02 Mar 2009
Posts: 15

Hello,

We have a legacy C++ program. When it starts, it launches a number of threads. Each thread makes one MQCONN() call to connect to a local queue manager. The program has been running on Solaris 10 servers for 10+ years.

The program is imported to Linux. When it starts on Linux as a daemon, 2002 is returned by MQCONN(). If MQCONN() is replaced with MQCONNX() and MQCNO_HANDLE_SHARE_BLOCK, 2059 is returned.

A 64-bit MQ is installed on the Linux server, but the program is built with 32-bit, and linked in with the following MQ libraries:
-lmqm -lmqmcs -lmqmzse

Any idea what the problems might be?

We would appreciate very much if you could help!

Guogang Li
CSG International, Inc
Back to top
View user's profile Send private message
tczielke
PostPosted: Fri Jun 16, 2017 2:57 pm Post subject: Reply with quote

Yatiri

Joined: 08 Jul 2010
Posts: 652
Location: Illinois, USA

Did you validate your compile command against the MQ manual for building C++ applications on Linux?

https://www.ibm.com/support/knowledgecenter/SSFKSJ_8.0.0/com.ibm.mq.dev.doc/q028480_.htm

-lpthread is one of the requirements for building threaded C++ MQ applications on Linux, and I don't see that in what you provided.
_________________
MQ administrator since 2010.
Back to top
View user's profile Send private message
fjb_saper
PostPosted: Fri Jun 16, 2017 5:36 pm Post subject: Reply with quote

Grand Poobah

Joined: 18 Nov 2003
Posts: 19382
Location: LI,NY

to be more specific here is the gcc command as given by the manual(thanks tczielke for the link)
Code:
//C++ server application, 32-bit, threaded example imqsput
g++ -m32 -fsigned-char -o imqsput_32_r imqsput.cpp -I MQ_INSTALLATION_PATH/inc -L MQ_INSTALLATION_PATH/lib -Wl,-rpath= MQ_INSTALLATION_PATH/lib -Wl,-rpath=/usr/lib -limqs23gl_r -limqb23gl_r -lmqm_r -lpthread
:innocent
_________________
MQ & Broker admin
Back to top
View user's profile Send private message Send e-mail
guogangli
PostPosted: Sat Jun 17, 2017 10:11 am Post subject: Reply with quote

Novice

Joined: 02 Mar 2009
Posts: 15

tczielke & fjb_saper,

Thank you so much for your help. The MQ libraries linked in is exactly the problem.

Once it's linked in with the correct libraries on Linux, the program connects to the queue manager successfully from multiple threads, just like the one running on Solaris.

Thanks again,

Guogang Li
CSG International, Inc
Back to top
View user's profile Send private message
Display posts from previous:
Post new topicReply to topic Page 1 of 1

MQSeries.net Forum IndexIBM MQ API Support2002 is returned by MQCONN on Linux
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.