Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我最近发现,只要我使用 -mno-cygwin 标志,我就可以使用 g++ 制作没有外部依赖项的 Windows 可执行文件。我的印象是编译器使用 MinGW 库而不是 cygwin。
这是使用 cygwin 构建没有 gpl 许可问题的二进制文件的有效方法吗?
除了更大的可执行文件之外,还有任何技术上的副作用吗?(即,失去 cygwin 特定的功能,受限的功能)
此功能是否记录在任何地方?我只能找到几年前描述它的新闻组帖子。
该-mno-cygwin标志删除了对 Cygwin 的所有依赖项,因此您的程序将不依赖 cygwin1.dll,也不依赖于 Unix 环境的存在。生成的可执行文件就像是使用 MinGW 工具链而不是 Cygwin 编译的一样。标准函数无法识别或理解 Unix 风格的路径或符号链接,因为它们是在 Cygwin 中实现的。
-mno-cygwin
我不记得它在哪里,但是 Cygwin 中有一个帮助文档解释了它。