简体   繁体   English

在 Ubuntu 18.04 上编译 Qt 程序,它将在 Ubuntu 14.04 上运行

[英]Compile Qt program on Ubuntu 18.04 which will run on Ubuntu 14.04

Interesting delema.有趣的德莱玛。

Trying to compile Qt program where Qt is build from source on 18.04 64-bit and run it on 14.04.尝试编译 Qt 程序,其中 Qt 是在 18.04 64 位上从源代码构建的,并在 14.04 上运行。 The interesting part is trying to identify which libraries I need this time.有趣的部分是试图找出我需要这个时间,这库。 The C++ ABI has changed. C++ ABI 已更改。

Looking to see if anyone else has done this recently?想看看最近有没有其他人这样做过? Which libraries do I have to bring along?我必须携带哪些图书馆? Yes, I know about ldd and readelf and have spent days trying this in various VMs.是的,我知道 ldd 和 readelf 并且已经在各种虚拟机中尝试了几天。 The problem is once you start bringing the C++ stuff over (because the ABI has changed yet again) you get to a point where your VM won't reboot.问题是一旦你开始引入 C++ 的东西(因为 ABI 再次改变了),你的 VM 将无法重新启动。

Please don't suggest snappy, flatpak or one of those other new "container" solutions.请不要推荐 snappy、flatpak 或其他新的“容器”解决方案之一。 Already wasted 3+ days on snappy.已经在 snappy 上浪费了 3+ 天。 It's architecture specific and only supports building on 14.04 when it comes to Qt, at least the deployqt tool to make an AppImage does.它是特定于架构的,并且在 Qt 方面仅支持在 14.04 上构建,至少用于制作 AppImage 的 deployqt 工具是这样。

Did this years ago with this very program.几年前用这个程序做了这个。 Built a debian which would install on both 64-bit and 32-bit for every version from 12.04 to 15.04 including the short lived .10 and odd year versions.构建了一个 debian,它可以安装在 64 位和 32 位上,适用于从 12.04 到 15.04 的每个版本,包括短暂的 .10 和奇数年版本。

I tried compiling QT with C++11 standard, but, it will no longer compile with that standard.我尝试使用 C++11 标准编译 QT,但是,它将不再使用该标准进行编译。

The incompatible ABI is the real killer.不兼容的 ABI 才是真正的杀手。

It is more than one program so the hack of a shell script using LD_LIBRARY_PATH would bring considerable difficulty.它不仅仅是一个程序,因此使用 LD_LIBRARY_PATH 破解 shell 脚本会带来相当大的困难。

Appreciate insights.欣赏见解。

Thank you.谢谢你。

Please always develop applications on the oldest distribution you still want your application to run on.请始终在您仍希望应用程序运行的最旧发行版上开发应用程序。 For example, if you want your application to run on all currently still-supported versions of Ubuntu, then develop your application on Ubuntu 14.04 and do not install any newer compilers or libraries than what it comes with.例如,如果您希望您的应用程序在所有当前仍受支持的 Ubuntu 版本上运行,那么请在 Ubuntu 14.04 上开发您的应用程序,并且不要安装任何比它附带的更新的编译器或库。

This is how "backward compatibility" works.这就是“向后兼容性”的工作原理。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM