Fix to compile

I took some time to fix all compilation errors caused by outdated library references. I was able to compile it under Ubuntu 13.10.

Actually, I didn't try to understand the code, I just looked for changes in referenced libraries and applied them to the existing code. Please, don't hesitate to share any thoughts.