2

I have an application compiled in Ubuntu 16.04 that depends on many libraries, like Qt, boost and many others with the version that comes with that version. However, I need to run this application in a webserver that is running Ubuntu 12.04, and I don't have root access on it.

When I try to run the application, it complains about the libraries that are in different version or not existent.

For trying to solve that, I had copied every library that ldd reports to a folder and tried to run the application with LD_LIBRARY_PATH pointing to that folder, but the application had received segmentation fault signal.

Compiling the application in Ubuntu 12.04 is not possible, because I'm using features that are not present in older versions of the libraries. Furthermore, I'm not planning to build newer libraries on the old system.

So, my question is: how can I run an application that is being compiled in a new version of Ubuntu, on an old version of Ubuntu?

2

The easiest solution?

Build an Ubuntu 12 server that replicates the Ubuntu 12 server you need to run your application on, and compile a version on that server.

Because there's no way you can cover everything - even if you get all the shared objects correct, the kernel interface is likely to be different.

  • The application don't compile in older versions of the libraries I'm using that are default in Ubuntu. – Fernando Aug 18 '17 at 20:06
  • 1
    @Fernando Take note of which libraries cause problems and build the proper versions alongside the application. Distribute them as a collection, in the same way that Windows programs do with DLLs – Fox Aug 18 '17 at 21:01
  • @Fernando You're in a tough spot. As @ Fox says you might have to build versions of the libraries you need. One thing that can help is if every library you have to build on Ubuntu 12, you build it as a static library. That way you won't have to package the shared object. You pretty much have to build everything on Ubuntu 12, though. And you may find you need to build a lot of libraries, and you may also find something that your app code or libraries make use of that's not available in Ubuntu 12. Then things get real fun. You're funding out why developers drop support for older OS versions. – Andrew Henle Aug 18 '17 at 23:42
  • 1
    @Fox In my experience, it's better to build custom libraries like that as static archives instead of shared objects. – Andrew Henle Aug 18 '17 at 23:43
  • Why do I can't just copy every library that the application use to the old system and the application just work? I'm assuming that the linker should just place the code in memory and that there is no kernel function that has changed between versions. I have tried that, but I had no success. – Fernando Aug 21 '17 at 12:55

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.