Author |
Message
|
AmolKatyare |
Posted: Tue Jan 17, 2006 10:39 pm Post subject: Problem in linking MQ lib on SUN |
|
|
Newbie
Joined: 17 Jan 2006 Posts: 6
|
I am trying to build the code against libimqb23as.so libimqc23as.so libimqs23as.so libs.
But getting following linker error:
Undefined symbol: ImqStr::pasteIn(const double, const char*)
The same code build is OK on AIX.
Do I need to link few more lib on SUN? |
|
Back to top |
|
 |
mvic |
Posted: Wed Jan 18, 2006 2:23 am Post subject: Re: Problem in linking MQ lib on SUN |
|
|
 Jedi
Joined: 09 Mar 2004 Posts: 2080
|
|
Back to top |
|
 |
AmolKatyare |
Posted: Wed Jan 18, 2006 3:26 am Post subject: |
|
|
Newbie
Joined: 17 Jan 2006 Posts: 6
|
Thanks for the reply.
I tried the compilation options given in the link. (-xarch=v8plus for 32-bit application on Solaris) But still getting the same linker errors.
I am running on MQ6.0 |
|
Back to top |
|
 |
mvic |
Posted: Wed Jan 18, 2006 3:28 am Post subject: |
|
|
 Jedi
Joined: 09 Mar 2004 Posts: 2080
|
AmolKatyare wrote: |
But still getting the same linker errors.
I am running on MQ6.0 |
Kindly post full compiler command you're using, and full output on stdout and stderr - simple copy / paste from the console is best. |
|
Back to top |
|
 |
AmolKatyare |
Posted: Wed Jan 18, 2006 4:06 am Post subject: |
|
|
Newbie
Joined: 17 Jan 2006 Posts: 6
|
I use mkmk compilation commands. It internally uses CC.
The linking lib are specified in another file. The contents of this file:
OS = SunOS
LINK_WITH=JS0LIB0 VX0TOOLS imqs23as imqb23as mqm mqmcs mqmzse
LOCAL_CCFLAGS= -xarch=v8plus
You can see the CC flags mentioned in this file are shown in CC command
Following are the details of the command:
# + CC -mt -Qoption ld -Bsymbolic,-Bdirect,-zlazyload,-znodefs -G -hlibENOVMQMsgHandler.so -Qoption ld -zmuldefs -xarch=v8plus -features=%none,anachronisms,except
,namespace,rtti -features=no%except -xO2 -w -mt -xarch=v8plusa -xchip=ultra3i -KPIC -compat=4 -library=iostream -instances=global -dalign -xbuiltin=%all -xlibmil
-xldscope=symbolic -D_LANGUAGE_CPLUSPLUS -D_SUNOS_SOURCE -D_ENDIAN_BIG -DOS_SunOS -DCNEXT_CLIENT -D_MK_CONTNAME_=ENOVMQMsgHandler -D_MK_MODNAME_=ENOVMQMsgHandler
-D_MK_FWNAME_=ENOVMQCommunication -norunpath -R /usr/lib /u/users/bqz/SCM/bqz_R17_MQ/./ENOVMQCommunication/ENOVMQMsgHandler.m/Objects/solaris_a/ENOVMQBase.o /u/us
ers/bqz/SCM/bqz_R17_MQ/./ENOVMQCommunication/ENOVMQMsgHandler.m/Objects/solaris_a/ENOVMQBinary.o /u/users/bqz/SCM/bqz_R17_MQ/./ENOVMQCommunication/ENOVMQMsgHandle
r.m/Objects/solaris_a/ENOVMQElement.o /u/users/bqz/SCM/bqz_R17_MQ/./ENOVMQCommunication/ENOVMQMsgHandler.m/Objects/solaris_a/ENOVMQFileAndMQTools.o /u/users/bqz/S
CM/bqz_R17_MQ/./ENOVMQCommunication/ENOVMQMsgHandler.m/Objects/solaris_a/ENOVMQFileChunk.o /u/users/bqz/SCM/bqz_R17_MQ/./ENOVMQCommunication/ENOVMQMsgHandler.m/Ob
jects/solaris_a/ENOVMQFileStatus.o /u/users/bqz/SCM/bqz_R17_MQ/./ENOVMQCommunication/ENOVMQMsgHandler.m/Objects/solaris_a/ENOVMQList.o /u/users/bqz/SCM/bqz_R17_MQ
/./ENOVMQCommunication/ENOVMQMsgHandler.m/Objects/solaris_a/ENOVMQListIterator.o /u/users/bqz/SCM/bqz_R17_MQ/./ENOVMQCommunication/ENOVMQMsgHandler.m/Objects/sola
ris_a/ENOVMQLog.o /u/users/bqz/SCM/bqz_R17_MQ/./ENOVMQCommunication/ENOVMQMsgHandler.m/Objects/solaris_a/ENOVMQMessageReceiver.o /u/users/bqz/SCM/bqz_R17_MQ/./ENO
VMQCommunication/ENOVMQMsgHandler.m/Objects/solaris_a/ENOVMQMessageSender.o /u/users/bqz/SCM/bqz_R17_MQ/./ENOVMQCommunication/ENOVMQMsgHandler.m/Objects/solaris_a
/ENOVMQObject.o /u/users/bqz/SCM/bqz_R17_MQ/./ENOVMQCommunication/ENOVMQMsgHandler.m/Objects/solaris_a/ENOVMQProperties.o /u/users/bqz/SCM/bqz_R17_MQ/./ENOVMQComm
unication/ENOVMQMsgHandler.m/Objects/solaris_a/ENOVMQString.o /u/users/bqz/SCM/bqz_R17_MQ/./ENOVMQCommunication/ENOVMQMsgHandler.m/Objects/solaris_a/mkCAAV5Licens
ing.o -L/u/users/bqz/SCM/bqz_R17_MQ/./solaris_a/code/lib -L/u/lego/CXR17rel/BSF/./solaris_a/code/lib -L/u/lego/CXR17rel/BSFTST/./solaris_a/code/lib -L/u/users/bqz
/SCM/bqz_R17_MQ/./solaris_a/code/bin -L/u/lego/CXR17rel/BSF/./solaris_a/code/bin -L/u/lego/CXR17rel/BSFTST/./solaris_a/code/bin -L/usr/dt/lib -L/usr/openwin/lib -
L/lib -L/usr/lib -lM77 -lF77 -lfsu -lJS0GROUP -lVX0TOOLS -limqs23as -limqb23as -lmqm -lmqmcs -lmqmzse -lsunmath -lm -lC -o /u/users/bqz/SCM/bqz_R17_MQ/./solaris_a
/code/bin/libENOVMQMsgHandler.so
# + stdout = [/tmp/mkStdRAAfYaW7X]
# + stderr = [/tmp/mkStdRAAfYaW7X]
# + environment(1): LD_LIBRARY_PATH =
# + environment(2): TMP = /u/users/bqz/SCM/bqz_R17_MQ/./ENOVMQCommunication/ENOVMQMsgHandler.m/Objects/solaris_a
Undefined first referenced
symbol in file
ImqStr::pasteIn(const double, const char*) /u/users/bqz/SCM/bqz_R17_MQ/./ENOVMQCommunication/ENOVMQMsgHandler.m/Objects/solaris_a/ENOVMQString.o
ImqBin::isNull(void) const /u/users/bqz/SCM/bqz_R17_MQ/./ENOVMQCommunication/ENOVMQMsgHandler.m/Objects/solaris_a/ENOVMQBinary.o
ImqChl::setChannelName(const char*) /u/users/bqz/SCM/bqz_R17_MQ/./ENOVMQCommunication/ENOVMQMsgHandler.m/Objects/solaris_a/ENOVMQBase.o
ImqStr::copyOut(ImqStr&, const char) const /u/users/bqz/SCM/bqz_R17_MQ/./ENOVMQCommunication/ENOVMQMsgHandler.m/Objects/solaris_a/ENOVMQString.o
ImqQue::get(ImqMsg&, ImqGmo3&) /u/users/bqz/SCM/bqz_R17_MQ/./ENOVMQCommunication/ENOVMQMsgHandler.m/Objects/solaris_a/ENOVMQMessageReceiver.o
ImqChl::ImqChl(void) /u/users/bqz/SCM/bqz_R17_MQ/./ENOVMQCommunication/ENOVMQMsgHandler.m/Objects/solaris_a/ENOVMQBase.o
ImqObj::close(void) /u/users/bqz/SCM/bqz_R17_MQ/./ENOVMQCommunication/ENOVMQMsgHandler.m/Objects/solaris_a/ENOVMQBase.o
ImqStr::copyOut(char*, const unsigned int, const char) /u/users/bqz/SCM/bqz_R17_MQ/./ENOVMQCommunication/ENOVMQMsgHandler.m/Objects/solaris_a/ENOVMQFileA
ndMQTools.o
ImqStr::ImqStr(void) /u/users/bqz/SCM/bqz_R17_MQ/./ENOVMQCommunication/ENOVMQMsgHandler.m/Objects/solaris_a/ENOVMQBase.o
ImqMgr::ImqMgr(void) /u/users/bqz/SCM/bqz_R17_MQ/./ENOVMQCommunication/ENOVMQMsgHandler.m/Objects/solaris_a/ENOVMQBase.o
ImqCac::write(const unsigned int, const char*) /u/users/bqz/SCM/bqz_R17_MQ/./ENOVMQCommunication/ENOVMQMsgHandler.m/Objects/solaris_a/ENOVMQFileAndMQT
ools.o
ImqStr::ImqStr(const ImqStr&) /u/users/bqz/SCM/bqz_R17_MQ/./ENOVMQCommunication/ENOVMQMsgHandler.m/Objects/solaris_a/ENOVMQBase.o
ImqChl::setPassword(const char*) /u/users/bqz/SCM/bqz_R17_MQ/./ENOVMQCommunication/ENOVMQMsgHandler.m/Objects/solaris_a/ENOVMQBase.o
ImqStr::set(const char*, const unsigned int) /u/users/bqz/SCM/bqz_R17_MQ/./ENOVMQCommunication/ENOVMQMsgHandler.m/Objects/solaris_a/ENOVMQString.o |
|
Back to top |
|
 |
mvic |
Posted: Wed Jan 18, 2006 4:21 am Post subject: |
|
|
 Jedi
Joined: 09 Mar 2004 Posts: 2080
|
The inclusion of "-compat=4" may be the cause of the problem here. MQ 6 on Solaris (and also 5.3 I think, but haven't checked) supports only version 5 C++ compiling / linking. |
|
Back to top |
|
 |
AmolKatyare |
Posted: Wed Jan 18, 2006 4:37 am Post subject: |
|
|
Newbie
Joined: 17 Jan 2006 Posts: 6
|
I checked with "-compat=5"; but still no change in the output. |
|
Back to top |
|
 |
mvic |
Posted: Wed Jan 18, 2006 5:25 am Post subject: |
|
|
 Jedi
Joined: 09 Mar 2004 Posts: 2080
|
AmolKatyare wrote: |
I checked with "-compat=5"; but still no change in the output. |
Please kindly post full details, as before. |
|
Back to top |
|
 |
mvic |
Posted: Wed Jan 18, 2006 5:39 am Post subject: |
|
|
 Jedi
Joined: 09 Mar 2004 Posts: 2080
|
mvic wrote: |
Please kindly post full details, as before. |
On second thoughts, there is more to say here. All objects and libraries in the link must have been compiled without -compat=4.
The command you pasted into the forum was a link command. It is evident from the output that the object "u/users/bqz/SCM/bqz_R17_MQ/./ENOVMQCommunication/ENOVMQMsgHandler.m/Objects/solaris_a/ENOVMQBase.o", and other objects too, require certain symbols that are not available in the libimq* libraries in your installation. Most likely (in my view) this is due to changes for version 5 of Sun's C++.
If I have got this right, the only answer is to re-compile every object that is included in that link. I'll be happy if I am proved wrong, but this is my opinion on what is the cause of your problem here.  |
|
Back to top |
|
 |
AmolKatyare |
Posted: Wed Jan 18, 2006 11:33 pm Post subject: |
|
|
Newbie
Joined: 17 Jan 2006 Posts: 6
|
Thanks for the reply.
I was wrong when I said LOCAL_CCFLAGS= -compat=5 really modifies compatibility mode. This is evident from the output of link command. For post CC operations, it is still using compat=4.(Marked in RED)
# make: ENOVMQCommunication/ENOVMQMsgHandler.m solaris_a/code/bin/libENOVMQMsgHandler.so
# + CC -mt -Qoption ld -Bsymbolic,-Bdirect,-zlazyload,-znodefs -G -hlibENOVMQMsgHandler.so -Qoption ld -zmuldefs -xarch=v8plus -compat=5 -features=%none,anachroni
sms,except,namespace,rtti -features=no%except -xO2 -w -mt -xarch=v8plusa -xchip=ultra3i -KPIC -compat=4 -library=iostream -instances=global -dalign -xbuiltin=%all
-xlibmil -xldscope=symbolic -D_LANGUAGE_CPLUSPLUS -D_SUNOS_SOURCE -D_ENDIAN_BIG -DOS_SunOS -DCNEXT_CLIENT -D_MK_CONTNAME_=ENOVMQMsgHandler -D_MK_MODNAME_=ENOVMQM
sgHandler -D_MK_FWNAME_=ENOVMQCommunication -norunpath -R /usr/lib /u/users/bqz/SCM/bqz_R17_MQ/./ENOVMQCommunication/ENOVMQMsgHandler.m/Objects/solaris_a/ENOVMQBa
se.o /u/users/bqz/SCM/bqz_R17_MQ/./ENOVMQCommunication/ENOVMQMsgHandler.m/Objects/solaris_a/ENOVMQBinary.o /u/users/bqz/SCM/bqz_R17_MQ/./ENOVMQCommunication/ENOVM
QMsgHandler.m/Objects/solaris_a/ENOVMQElement.o /u/users/bqz/SCM/bqz_R17_MQ/./ENOVMQCommunication/ENOVMQMsgHandler.m/Objects/solaris_a/ENOVMQFileAndMQTools.o /u/u
sers/bqz/SCM/bqz_R17_MQ/./ENOVMQCommunication/ENOVMQMsgHandler.m/Objects/solaris_a/ENOVMQFileChunk.o /u/users/bqz/SCM/bqz_R17_MQ/./ENOVMQCommunication/ENOVMQMsgHa
ndler.m/Objects/solaris_a/ENOVMQFileStatus.o /u/users/bqz/SCM/bqz_R17_MQ/./ENOVMQCommunication/ENOVMQMsgHandler.m/Objects/solaris_a/ENOVMQList.o /u/users/bqz/SCM/
bqz_R17_MQ/./ENOVMQCommunication/ENOVMQMsgHandler.m/Objects/solaris_a/ENOVMQListIterator.o /u/users/bqz/SCM/bqz_R17_MQ/./ENOVMQCommunication/ENOVMQMsgHandler.m/Ob
jects/solaris_a/ENOVMQLog.o /u/users/bqz/SCM/bqz_R17_MQ/./ENOVMQCommunication/ENOVMQMsgHandler.m/Objects/solaris_a/ENOVMQMessageReceiver.o /u/users/bqz/SCM/bqz_R1
7_MQ/./ENOVMQCommunication/ENOVMQMsgHandler.m/Objects/solaris_a/ENOVMQMessageSender.o /u/users/bqz/SCM/bqz_R17_MQ/./ENOVMQCommunication/ENOVMQMsgHandler.m/Objects
/solaris_a/ENOVMQObject.o /u/users/bqz/SCM/bqz_R17_MQ/./ENOVMQCommunication/ENOVMQMsgHandler.m/Objects/solaris_a/ENOVMQProperties.o /u/users/bqz/SCM/bqz_R17_MQ/./
ENOVMQCommunication/ENOVMQMsgHandler.m/Objects/solaris_a/ENOVMQString.o /u/users/bqz/SCM/bqz_R17_MQ/./ENOVMQCommunication/ENOVMQMsgHandler.m/Objects/solaris_a/mkC
AAV5Licensing.o -L/u/users/bqz/SCM/bqz_R17_MQ/./solaris_a/code/lib -L/u/lego/CXR17rel/BSF/./solaris_a/code/lib -L/u/lego/CXR17rel/BSFTST/./solaris_a/code/lib -L/u
/users/bqz/SCM/bqz_R17_MQ/./solaris_a/code/bin -L/u/lego/CXR17rel/BSF/./solaris_a/code/bin -L/u/lego/CXR17rel/BSFTST/./solaris_a/code/bin -L/usr/dt/lib -L/usr/ope
nwin/lib -L/lib -L/usr/lib -lM77 -lF77 -lfsu -limqs23as -limqb23as -lmqm -lmqmcs -lmqmzse -lsunmath -lm -lC -o /u/users/bqz/SCM/bqz_R17_MQ/./solaris_a/code/bin/li
bENOVMQMsgHandler.so
The problem seems to be with our mkmk tools. It uses compat=4 by default.
Per your previous posting, I understand that we must have compat=5 for compiling/linking. Is it possible for you to send the link which supports this statement? |
|
Back to top |
|
 |
mvic |
Posted: Thu Jan 19, 2006 1:56 am Post subject: |
|
|
 Jedi
Joined: 09 Mar 2004 Posts: 2080
|
AmolKatyare wrote: |
Is it possible for you to send the link which supports this statement? |
I don't have any real examples to quote right now, sorry. In principle, though, just omit the "-compat=4" and the version 5 compilers will assume -compat=5. NB. there is no -compat=x in my theoretical example:
Code: |
CC -mt -c <compile flags...> -o file.o <defines...> <includes...> file.c |
As for the link, I expect the -compat=x option not to have any effect (can't check right now, as I can't access my Sun machine) so a theoretical example would be
Code: |
CC -mt <link flags...> -o pgmfile <libs...> <objects...> |
I hope this is OK - were you looking for more than this? |
|
Back to top |
|
 |
AmolKatyare |
Posted: Thu Jan 19, 2006 3:24 am Post subject: |
|
|
Newbie
Joined: 17 Jan 2006 Posts: 6
|
I was looking for the link which supports the statement that one cannot use -compat=4 for linking Solaris libs.
Anyway, right now I am running into another problem. We cannot use
-compat=5 (default compatibility mode) with any of the following options.
Use of -compat=5 with any of the following options is not supported.
o -Bsymbolic
o +e
o -features=[no%]arraynew
o -features=[no%]explicit
o -features=[no%]namespace
o -features=[no%]rtti
o -library=[no%]complex
o -library=[no%]libC
o -vdelx
(Ref:http://developers.sun.com/prodtech/cc/documentation/ss10_docs/mr/man1/CC.1.html)
Two of these options (-features=[no%]arraynew and -features=[no%]explicit) are being used in CC by our compilation tools. First, I need to get rid of them so that I can have compat=5.
Thanks for all the help. I hope you don't mind if I get back to you again. |
|
Back to top |
|
 |
mvic |
Posted: Thu Jan 19, 2006 4:51 am Post subject: |
|
|
 Jedi
Joined: 09 Mar 2004 Posts: 2080
|
|
Back to top |
|
 |
|