the_interest_seeker
the_interest_seeker

Reputation: 94

Deployment of statically linked Qt application backward compatibility

This is my first attempt at making a Qt Application work on different systems.

I have opted for static linking method.I have already compiled the sources of Qt 5.5 and compiled my application with the static Qt. The executable is working fine on my computer. My operating system is Ubuntu 15.04. But when I tried to run the same executable on Ubuntu 14.04 then I ran into trouble. The key details of the error message are given below.

libstdc++.so.6 cxxabi_1.3.8 not found

I did a standard Google search and realised it was because I had a newer version of it on my machine, the machine where I had created the executable. There were so many different approaches to handle this problem. One of the solutions I saw involved shipping your own copy of libstdc++.so with the executable. But when I tried to copy the .so file to a pen drive, there was a warning saying that the file system does not support such files.

My question is , what am I doing wrong ? Also if I wanted to make the executable target Ubuntu 10.04, what would be the correct procedure handling the backward compatibility issues. I know that one method would be to install the same OS on my machine and then create the executable , is there any other way?

Upvotes: 1

Views: 149

Answers (1)

Simon Warta
Simon Warta

Reputation: 11418

libstd++ is backward compatible but not forward compatible, which means you can run a program with a newer version of libstdc++ than the one you compiled it with but not vice-versa. This is what you experienced.

One way to deal with this issue is using older OS versions as the build machine. When you for example use Ubuntu 14.04 LTS, you'll get this list of compatible target systems.

The build system you're using will probably limit available compilers. On Ubuntu 14.04 you get GCC 4.8, which is good for most C++11 and packages for clang 3.6 are available, which will give you full C++14 support.

Targeting Ubuntu 10.04 will be challenging if you do not want to use a stone age compiler.

The idea of shipping libstdc++ will not help you much because you'll run into the same problem with libc.

Upvotes: 1

Related Questions