I see a pattern - the libs not found have a version number. They should also be removed (along with the .so), let the linker determine the version. How it will decide between 4.7 and 4.8 when you tell it to load libdb is an exercise for someone else. I hate linkers. -y