I have an Eclipse RCP application which I want to run in Linux environment that has multiple gtks installed.
Is there a way to choose the gtk version against which I can run the application?
Linux flavour: openSUSE
Window Manager: iceWM
gtk+ versions installed: 1.2.10 & 2.2.1
It may be possible. You can check the shared libraries loaded by your program with the command ldd: for instance,
# ldd /usr/sbin/openvpn
linux-vdso.so.1 => (0x00007ffffb5fe000)
liblzo2.so.2 => /lib/x86_64-linux-gnu/liblzo2.so.2 (0x00007fc3dc936000)
libpthread.so.0 => /lib/x86_64-linux-gnu/libpthread.so.0 (0x00007fc3dc719000)
libpkcs11-helper.so.1 => /usr/lib/x86_64-linux-gnu/libpkcs11-helper.so.1 (0x00007fc3dc4ff000)
libssl.so.1.0.0 => /lib/x86_64-linux-gnu/libssl.so.1.0.0 (0x00007fc3dc2a1000)
libcrypto.so.1.0.0 => /lib/x86_64-linux-gnu/libcrypto.so.1.0.0 (0x00007fc3dbec5000)
libdl.so.2 => /lib/x86_64-linux-gnu/libdl.so.2 (0x00007fc3dbcc0000)
libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007fc3db8f8000)
libz.so.1 => /lib/x86_64-linux-gnu/libz.so.1 (0x00007fc3db6df000)
this shows all libraries invoked by openvpn. The libraries whose name ends in .so.N where N is a single digit (any single digit) are actually links to the real libraries. Take libz.so.1 as an example:
[email protected]:/lib/x86_64-linux-gnu# find / -type f -name 'libz.so.1*' -print
[email protected]:/lib/x86_64-linux-gnu# ls /lib/x86_64-linux-gnu/libz.so.*
[email protected]:/lib/x86_64-linux-gnu# file /lib/x86_64-linux-gnu/libz.so.*
/lib/x86_64-linux-gnu/libz.so.1: symbolic link to `libz.so.1.2.8'
/lib/x86_64-linux-gnu/libz.so.1.2.8: ELF 64-bit LSB shared object, x86-64, version 1 (SYSV), dynamically linked, BuildID[sha1]=0x42bce97e9a0f7a78fcdb3b79d11f67b02abc522c, stripped
The ldd command shows what the loaded library, libz.so.1 (btw, this is called the shared library's soname) resolves to, and the follwoing commands find the library, and show that the soname is actually a link to the shared library's real name.
You may hope to determine which shared library is loaded by altering this link.
There's a certain number of caveats to this, the most important of which is that, while you are generally safe in substituting different minor versions of the same major version (for instance, using libz.so.1.2.8 instead of libz.1.1.6) is fine, while substituting versions differing in their major number (the first number following so) is not possible. According to the tldp.org page,
Programs, when they internally list the shared libraries they need, should only list the soname they need.
This implies you will be unable to substitute two versions of the same shared library belonging to different major versions.
In any case, I suggest the above link for further clarification.