开发者

Shared Lib version mismatch during compilation?

开发者 https://www.devze.com 2023-02-06 20:01 出处:网络
I am getting some compilation errors compiling some C code on my Mint Linux install. The errors are ALL version mismatch issues.

I am getting some compilation errors compiling some C code on my Mint Linux install.

The errors are ALL version mismatch issues.

Here is a section of the "make error":

/usr/bin/ld: warning: libthread.so.1, needed by /home/lynton/Backup/Logosworld/IBM/Websphere MQ for Solaris x86 64bit/CZRV9ML/mqm/root/opt/mqm/lib64/libmqm.so, not found (try using -rpath or -rpath-link)
/usr/bin/ld: warning: libsocket.so.1, needed by /home/lynton/Backup/Logosworld/IBM/Websphere MQ for Solaris x86 64bit/CZRV9ML/mqm/root/opt/mqm/lib64/libmqm.so, not found (try using -rpath or -rpath-link)
/usr/bin/ld: warning: libc.so.1, needed by /home/lynton/Backup/Logosworld/IBM/Websphere MQ for Solaris x86 64bit/CZRV9ML/mqm/root/opt/mqm/lib64/libmqm.so, not found (try using -rpath or -rpath-link)
/usr/bin/ld: warning: libdl.so.1, needed by /home/lynton/Backup/Logosworld/IBM/Websphere MQ for Solaris x86 64bit/CZRV9ML/mqm/root/opt/mqm/lib64/libmqm.so, not found (try using -rpath or -rpath-link)
/home/lynton/Backup/Logosworld/IBM/Websphere MQ for Solaris x86 64bit/CZRV9ML/mqm/root/opt/mqm/lib64/libmqm.so: undefined reference to `xihThreadKey'
/home/lynton/Backup/Logosworld/IBM/Websphere MQ for Solaris x86 64bit/CZRV9ML/mqm/root/opt/mqm/lib64/libmqm.so: undefined reference to `xcsCreateThreadMutexSemX'
/home/lynton/Backup/Logosworld/IBM/Websphere MQ for Solaris x86 64bit/CZRV9ML/mqm/root/opt/mqm/lib64/libmqm.so: undefined reference to `thr_getspecific'
/home/lynton/Backup/Logosworld/IBM/Websphere MQ for Solaris x86 64bit/CZRV9ML/mqm/root/opt/mqm/lib64/libmqm.so: undefined reference to `xcsReleaseThreadMutexSem'
/home/lynton/Backup/Logosworld/IBM/Websphere MQ for Solaris x86 64bit/CZRV9ML/mqm/root/opt/mqm/lib64/libmqm.so: undefined reference to `xcsRequestThreadMutexSem'
collect2: ld returned 1 exit status
make: *** [idoclink_outbound] Error 1

So for example it complains about "libsocket.so.1" but I only have "libsocket.so.0"?

How do C developers normally get around this sort of 开发者_如何学运维issue? Is there any way I can download those SPECIFIC libs that it is complaining about?

Thanks for the help ;-)

Lynton


You're trying to compile code written for Solaris on Linux, and neither the build system nor the code has been properly conditionalized so that this works. Clue one is the name of the build directory --

.../Websphere MQ for Solaris x86 64bit/...

clue two is that it seems to have hardwired a bunch of Solaris-specific dynamic library names (Linux doesn't have a libthread or a libsocket as far as I know, and its libc and libdl do not use those sonames -- I don't know where you got a libsocket.so.0, but it's probably something completely different than what this program is looking for) and clue three is

libmqm.so: undefined reference to `thr_getspecific'

where thr_getspecific is a decidedly non-portable, Solaris-specific library routine (the portable equivalent is pthread_getspecific, but porting is not simply a matter of changing the name in the code).

Go back to wherever you got the code and see if they have a Linux variant. If they don't, you may have a great deal of work ahead of you.


WebSphere MQ libraries are available with the Server or Client install. C developers normally get around this sort of issue by actually installing the WMQ software. Even assuming you manage to get the right WMQ libraries uncompressed, you will have a terrible time compiling if they are not installed to the expected locations. For example, the WMQ message catalog is installed into the NLS directories and is referenced during compiles. You might be able to resolve all the dependencies with compiler options pointing to each library but it would be a lot faster and easier to just install the software.

If all you need is the client libraries these are freely downloadable as SupportPac MQC7, although registration is required. If you need the server libraries, you would need to have purchased WMQ Server or downloaded the trial. The primary difference is that the server libraries can connect to a local QMgr using shared memory and the client libraries always connect over the network. If you need XA transactionality then you need the server licenses, regardless of how you connect. The XA functionality is part of the WMQ server distribution and incurs a license obligation on each node where it is used.

Once installed you should be able to compile programs, assuming you have all the prereq libraries such as the right libstdc++. These requirements are listed per-platform at the WMQ Detailed System Requirements page. Finally, there are detailed instructions as to how to build programs for WebSphere MQ on Linux in the Infocenter topic named, appropriately enough, Building your application on Linux. This section provides example compile commands, library path requirements and so forth.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号