我正在开发一个程序,该程序使用自动工具作为其构建系统,并在 Linux 上编译良好。为了针对 Windows 进行构建,我试图让 mingw 交叉编译器适用于 Windows。现在,当我在 Linux 上编译并转移到 Windows 时,我当然缺少一些 Windows 上默认未安装的 dll。这会导致缺少 dll 错误。由于 LGPL 的限制,我无法静态链接我的程序。
所以我的问题是在这种情况下交叉编译的正确方法是什么?我觉得我需要将我的 exe 包装在一个安装程序中,该安装程序会自动解析并安装 Windows 的 dll 依赖项,但我无法找到解释如何执行此操作的内容。基本上我正在考虑 Windows 的 yum/apt-get 。如何管理 Windows 上的 dll 依赖关系?我是 Linux 用户,不是 Windows 用户,所以请耐心等待。
I'm working on a program which uses autotools for its build system and compiles fine on linux. To build for windows I'm trying to get a mingw cross-compiler working for windows. Now when I compile on linux and move to windows of course I am missing some dll's that are not installed by default on windows. This leads to missing dll errors. I cannot statically link my program due to restrictions in the LGPL.
So my question is what is the correct way to cross compile in this situation? I feel like I need to wrap my exe in a installer which automatically resolves and installs the dll dependencies for windows but I haven't been able to locate something explaining how to do this. Basically I'm thinking of yum/apt-get for windows. How do I manage dll dependencies on windows? I'm a linux guy, not a windows guy, so please bear with me.
发布评论
评论(1)
也许最简单的事情就是您可以将开发转移到 Windows 计算机上。但除此之外,您还可以使用 Wine 在 Linux 机器上安装 Windows-Mingw。 (IIRC winetricks 甚至有一个目标)这样您就可以“感觉”Windows 上的问题。另一种选择是虚拟机中的 Windows,但 Wine 对于开发环境来说应该没问题。
我还强烈建议您安装 Microsoft Visual C++。快速版本就可以了。 MSVC++ 附带了许多工具,可以让您的生活变得更加轻松,例如 dll 依赖性检查器等。另一个优秀的信息源是 Sysinternals 工具rel="nofollow">博客。
Probably the easiest thing would be if you could move your development to a Windows machine. But short of that, you could install Windows-Mingw on your Linux machine using Wine. (IIRC winetricks has even a target for this) That way you get a "feel" for the issues on windows. An alternative could be Windows in a virtual machine, but Wine should be ok for a development environment.
I also strongly suggest that you install Microsoft Visual C++. The express versions will do fine. There are a number of tools coming with MSVC++ that can make your life a lot easier, like dll-dependency checker etc. An additional excellent source of information are the Sysinternals tools from Mark Russinovich and his blog.