cygwin 1.7 中生成的 .exe 无法在 cygwin 1.52 上运行
一年前,我为客户用 Perl 开发了一个小脚本,并使用 pp 开发了它的 .exe。 我们向客户提供了 .exe 文件以及基本的 cygwin(1.52) 安装文件以运行该 .exe。
现在我们在脚本中得到了增强。我们丢失了 cygwin 的所有开发环境。我们再次安装了 1.7 版本的新鲜 cygwin,编码并生成了 .exe 文件。此文件不在拥有 cygwin 1.52 的客户环境中运行。只是它会执行.exe后就没有反应了,
我们不能要求客户升级测试环境。 还有什么其他方法可以让它在 cygwin 1.52 上使用 cygwin dll 1.7 运行 .exe。 任何帮助将不胜感激。
平均值, 索姆
A year back i have developed a small script in perl for a customer and developed its .exe using pp .
we delivered .exe file along with basic cygwin(1.52) install files to run that .exe to customer.
Now we got an enhancement in the script .we lost all dev environment for cygwin .Again we installed fresh cygwin with 1.7 version ,coded and generated .exe file.this file is not running in the customer environment who have cygwin 1.52.Just it will be balnk after executing the .exe
we cannot ask customer to upgarde the test environment.
what is other way to make it run .exe with cygwin dll 1.7 on cygwin 1.52.
Any help would be higly appreciated.
Rgds,
sowm
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
Cygwin 的开发人员对向上兼容性非常严格,但他们不会尝试在主要版本之间提供向后兼容性,例如 1.5 和 1.7 之间。这意味着您可以在 1.7 上构建一个仅在 1.5 上运行的程序,只要您避免调用在 1.7 中添加到 Cygwin DLL 中的函数即可。
您的代码调用仅限 1.7 的函数的原因很可能是它使用自动发现平台功能的库。可能还有其他原因,但由于没有任何有关失败原因的详细信息,因此很难猜测。
如果问题是由于第三方库造成的,正如我猜测的那样,花时间弄清楚如何使它们恢复到 1.5 和 1.7 提供的通用功能可能是可行的。例如,对于基于 autoconf 的系统,您可以手动编辑配置脚本生成的 config.h 文件以关闭某些已发现功能的使用。这反过来意味着您自己从源代码构建所有这些库,而不是从 Cygwin 项目存储库下载二进制版本并直接使用它们。
从 Cygwin Time Machine 中提取 Cygwin 1.5 环境可能会更容易。
顺便说一句,您知道分发 Cygwin 和用它构建的可执行文件需要这些可执行文件遵守 GPL,或者您购买 Cygwin 商业分发许可证,对吧?如果没有请参阅常见问题解答。
The developers of Cygwin are strict about upward compatibility, but they don't try to provide backward compatibility between major releases, like between 1.5 and 1.7. This means you can build a program on 1.7 that runs on 1.5 only as long as you avoid calling functions that were added to the Cygwin DLL in 1.7.
Most likely the reason your code calls 1.7-only functions is that it is using libraries that auto-discover platform features. There could be other reasons, but without any details about what exactly is failing, it's difficult to guess.
If the problem is due to third-party libraries, as I'm guessing, it may be practical to spend time to figure out how to make them revert to the common functionality provided by both 1.5 and 1.7. For instance, with an autoconf-based system, you can hand-edit the
config.h
file the configure script produces to turn off use of some discovered features. This in turn means building all those libraries from source yourself, rather than downloading binary versions from the Cygwin project repository and using them directly.It may be easier to pull a Cygwin 1.5 environment out of the Cygwin Time Machine.
By the way, you are aware that distributing Cygwin and executables built with it requires that those executables comply with the GPL, or that you buy a Cygwin commercial distribution license, right? If not see the FAQ.
使用 http://cygwin.com/setup-legacy.exe 安装 1.5
Install 1.5 with http://cygwin.com/setup-legacy.exe