windows windows下可以使用glibc吗?

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/2120030/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-15 13:48:51  来源:igfitidea点击:

Can I use glibc under windows?

c++windowsglibc

提问by rubenvb

Is it (or would it) be possible to use glibc under windows (as a replacement of msvcrt)? I know this is a stupid question, and answers like cygwin will pop up, but I am really asking: is it possible to link to glibc on windows and use all library functions like with msvcrt?

是否(或是否)可以在 Windows 下使用 glibc(作为 msvcrt 的替代品)?我知道这是一个愚蠢的问题,并且会弹出像 cygwin 这样的答案,但我真的在问:是否可以在 Windows 上链接到 glibc 并使用所有库函数,例如 msvcrt?

采纳答案by Brian Haak

A possible workaround could exist: if someone combines http://0xef.wordpress.com/2012/11/17/emulate-linux-system-calls-on-windows/with http://www.musl-libc.org/and compiles source code with gcc against musl libc instead of glibc. So, I can't understand why nobody writes a such glibc analog for Windows. :-(

可能存在一种可能的解决方法:如果有人将http://0xef.wordpress.com/2012/11/17/emulate-linux-system-calls-on-windows/http://www.musl-libc.org/结合使用并使用 gcc 针对 musl libc 而不是 glibc 编译源代码。所以,我不明白为什么没有人为 Windows 编写这样的 glibc 模拟。:-(

回答by nos

glibc used to work on different *nixes once , these days glibc is quite Linux specific. It will certainly not work on windows.

glibc 曾经在不同的 *nixes 上工作过一次,现在 glibc 是非常特定于 Linux 的。它肯定不会在 Windows 上工作。