PERL MQSeries MQCONN issue

Hi,

I have an issue with a PERL5 script that calls MQCONN. I get this error on this Perl step when connecting to my Q manager: "Undefined Undefined subroutine &main::MQCONN called at ./quelog.pl "

I use this code:

$Hconn = MQCONN($QMGR,$CompCode,$Reason);

In my .profile:

export PERL5LIB="$PERL5LIB:/shared/tools/quelog/modules"

where I have my MQseries, MQCLIENT and MQSERVER. Please help !

Perl Version = perl 5, version 16, subversion 1 (v5.16.1) built for i686-linux-thread-multi
Linux OS: Red Hat 6.5

---------- Post updated at 06:05 PM ---------- Previous update was at 12:00 PM ----------

I tried to re-compile and I get this error:

gcc -c  -I"/opt/mqm/inc" -I../include -m32 -march=i686 -mtune=i686 -D_REENTRANT -D_GNU_SOURCE -fno-strict-aliasing -pipe -fstack-protector -I/usr/local/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -O2   -DVERSION=\"1.34\" -DXS_VERSION=\"1.34\" -fPIC "-I/vendor/perl5/lib/i686-linux-thread-multi/CORE"  -DMQ_CMVC_LVALUE=\"v7.5.0.6/p750-006-160226\" constants.c
Running Mkbootstrap for MQClient::MQSeries ()
chmod 644 MQSeries.bs
rm -f ../blib/arch/auto/MQClient/MQSeries/MQSeries.so
LD_RUN_PATH="/opt/mqm/lib" gcc  -shared -Wl,-rpath -Wl,/opt/mqm/lib MQSeries.o constants.o  -o ../blib/arch/auto/MQClient/MQSeries/MQSeries.so     \
           -L/opt/mqm/lib -lmqic        \
 MQSeries.o: could not read symbols: File in wrong format
collect2: ld returned 1 exit status

Rather than try to compile this external code into Perl, could you not just alter your Perl script to reference the library (directory) that your module is in?

There are various ways to do so, e.g.

  • -I flag (capital i )
  • A use lib /path/to/dir statement
  • A specific library call (if it is somewhere below one of the paths from perl -V

.... but being Perl, TIMTOADY (as they say)

I hope that this helps. Apologies if I've missed the point of your question.
Robin

I am using cpan now to install it and to compile which is more cleaner. However, I have this error still:

LD_RUN_PATH="/opt/mqm/lib" gcc  -shared -Wl,-rpath -Wl,/opt/mqm/lib MQSeries.o constants.o  -o ../blib/arch/auto/MQClient/MQSeries/MQSeries.so     \
           -L/opt/mqm/lib -lmqic        \
 MQSeries.o: could not read symbols: File in wrong format
collect2: ld returned 1 exit status
make[1]: *** [../blib/arch/auto/MQClient/MQSeries/MQSeries.so] Error 1
make[1]: Leaving directory `/u01/app/home/asmsadm/.cpan/build/MQSeries-1.34-WaLtYh/MQClient'
make: *** [subdirs] Error 2
  MQSERIES/MQSeries-1.34.tar.gz
  /usr/bin/make -- NOT OK

Please help !