Deploying Qt on CentOS - libc.so.6 update problem


 
Thread Tools Search this Thread
Operating Systems Linux Deploying Qt on CentOS - libc.so.6 update problem
# 1  
Old 01-18-2011
Deploying Qt on CentOS - libc.so.6 update problem

I am developing a simple client-server (TCP) application using QT. The server side is to run on CentOS. I am developing both the server and client programs using Ubuntu.

I am now attempting to deploy an experimental version of the server application on the CentOS server, but I am not yet familiar with all the vagaries of Linux and have run into some difficulties.

I started by copying the executable to the server, attempting to run it, and then copying the Qt libraries it reported as missing, one at a time. So far so good.

I then received a series of messages of the form:

#.../lib/libc.so.6: version `GLIBC_2.9' not found (required by /usr/lib/libQtGui.so.4)

On investigating I found that libc.so.6 was linked to libc-2.5.so on the server, but to libc-2.12.1.so on the development sysem. I duly copied libc-2.12.1.so to the server, updated libc.so.6 to point to it and attempted to run the executable again.

This resulted in the error message:

#...relocation error: /lib/libglib-2.0.so.0: symbol strncmp, version GLIBC_2.0 not defined in file libc.so.6 with link time reference

I quickly set the link back to what it was, in case anything else was broken by the change. No harm seems to have been done!

I would very much appreciate some advice on the correct way to do this!

Many thanks.
# 2  
Old 01-18-2011
Your development system has much newer software than your server, too new to still be compatible it seems. Replacing your current libc is a very bad idea -- I'm glad you didn't lock yourself out of your server, we get a new threads about "I messed up my libc now nothing works what do I do" with fair regularity.

I'd make the executable demand very specific versions and paths -- i.e. link in /usr/local/lib/libc-2.12.1.so instead of libc.so.6. Specific versions of any other libraries it complains about, too. Then you can copy them over to your server without overwriting existing libraries. I suggest /usr/local/lib instead of /lib/ or /usr/lib/ because that lets you track very carefully what things you've copied over by hand instead of dumping them in with the rest of the pile.

---------- Post updated at 11:51 AM ---------- Previous update was at 10:14 AM ----------

If you can add -Xlinker -R /usr/local/lib to your code when you compile it, that will force it to look in /usr/local/lib/ first, and fall back on /lib/ etc. if it doesn't find things available in there.

Code:
$ echo "int main() { return 42; }" > 42.c
$ gcc 42.c -o 42
$ ldd 42
        linux-gate.so.1 =>  (0xb7888000)
        libc.so.6 =>  /lib/libc.so.6 (0xb762b000)
        /lib/ld-linux.so.2 (0xb7889000)
$ cp /lib/libc.so.6 ./
$ gcc -Xlinker -rpath=$PWD 42.c -o 42
$ ldd ./42
        linux-gate.so.1 =>  (0xb78bb000)
        libc.so.6 => /home/tyler/code/c/1shot/libc.so.6 (0xb7771000)
        /lib/ld-linux.so.2 (0xb78bc000)
$ rm libc.so.6
$ ldd ./42
        linux-gate.so.1 =>  (0xb777a000)
        libc.so.6 => /lib/libc.so.6 (0xb7627000)
        /lib/ld-linux.so.2 (0xb777b000)


Last edited by Corona688; 01-18-2011 at 02:08 PM..
This User Gave Thanks to Corona688 For This Post:
# 3  
Old 01-18-2011
Many thanks for a full and helpful reply! I must admit I was a bit nervous about changing the libc link at the time - and relieved when the system survived in good order.

Last edited by David Brown; 01-18-2011 at 03:05 PM.. Reason: Corrected typo.
This User Gave Thanks to David Brown For This Post:
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. UNIX for Beginners Questions & Answers

Problem with cluster on centos 6.5

Hallo to everyone.From sometime i have problems with my asterisk pbx on cent os which is in corosync cluster mode with resource groups.The problem is for time the cluster just swap the active one with the other and the only messages in \var\log\messages is that bond0:link status defenitly down for... (0 Replies)
Discussion started by: evolintend
0 Replies

2. UNIX for Advanced & Expert Users

Centos - prevent yum update from breaking package configurations

i recently run on a centos server and this replaced the current config files with a new one. this happened with but i think it can happen with other packages as well. please advise how such issues can be prevented from happening again. (4 Replies)
Discussion started by: coolatt
4 Replies

3. Linux

Unable to access CentOS setup Network Configuration after attempting Python update

I attempted to update Python on my CentOS 5.6 VM and have encountered some issues after then. Initially yum wouldn't work, but I have resolved that. However, now I am unable to access the Network Configuration section under setup. When I do select this option I see this at the command line: ... (2 Replies)
Discussion started by: crmpicco
2 Replies

4. UNIX for Dummies Questions & Answers

Using symbolic link for database MySQL in CentOS, not update sizing

I have no idea what I should set the topic here ==' This is my story, please you there kindly help me I'm quite newbie for this. ================================== My host server is CentOS, I spared 9.9GB for /var path that used by MySQL and...It's full because of heavy load traffic, then... (1 Reply)
Discussion started by: Kapom
1 Replies

5. Red Hat

Bluetooth problem in CentOS 6

Hi , I have install centos6.3 64bit, other things are working fine.:b: I am trying to use bluetooth. It is showing bluetooth icons and options only turn on and turn off bletooth.:confused: How to enable full features of bluetooth like search, send file etc.:wall: (7 Replies)
Discussion started by: Priy
7 Replies

6. Red Hat

CentOS 6.2 update errors.

Hello Every one, plz help me out regarding the following outputs .... # yum update -y Loaded plugins: aliases, auto-update-debuginfo, changelog, downloadonly, : fastestmirror, filter-data, fs-snapshot, kabi, keys, list-data, : local, merge-conf,... (1 Reply)
Discussion started by: saqlain.bashir
1 Replies

7. HP-UX

hpux-itanium 64 bit problem for libC

i am trying to build on hpux-itanium 64 bit platform. my application needs to link to 64 bit version of the library libCsup.so This library is present in /usr/lib/hpux64/libCsup.so I am specifying the location of this library as linker flags LDFLAGS := -Wl,-N -Wl,+s... (0 Replies)
Discussion started by: skyineyes
0 Replies

8. UNIX for Dummies Questions & Answers

problem of networking in centos

Hello, I am using dual boot of linux, one is ubuntu and the other is one is centos. I have three NIC's and only one of them connected with cable. The thing is that when I boot from the ubuntu, it does recognize it and I am connected to the Internet. When I boot from the centos I am not... (6 Replies)
Discussion started by: programAngel
6 Replies

9. AIX

Problem restoring libc.a (AIX 5.3)

Hi, The symbolic link from /usr/lib/libc.a to /usr/ccs/lib/libc.a was deleted by accident. So we are trying to restore it, but we have some problems. After booting from CD, and access the rootvg volume group (without mounting the system), we tried to execute the next commands: mount /dev/hd4... (1 Reply)
Discussion started by: NicoAIX
1 Replies

10. UNIX for Dummies Questions & Answers

Centos commands: Yum Upgrade versus Yum update

Hi, I would like to know the difference between YUM UPDATE and YUM UPGRADE. The man pages say upgrade is same as update with the obsolete option. And by default it says the obsolete option is turned on, which would make them equivalent. Does not say what obsolete does. Can someone please... (3 Replies)
Discussion started by: mojoman
3 Replies
Login or Register to Ask a Question