C++ “sys/mman.h:没有那个文件或目录”
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/1810568/
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
"sys/mman.h: No such file or directory"
提问by Mohammed
I am using Code::Blocks 8.02 and I have a question .. every time I try to compile minimad.c (the example that comes with Libmad) I get an error message :
我正在使用 Code::Blocks 8.02 并且我有一个问题 .. 每次我尝试编译 minimad.c(Libmad 附带的示例)时,我都会收到一条错误消息:
sys/mman.h: No such file or directory
and of course a bunch of errors to follow :(
sys/mman.h: No such file or directory
当然还有一堆错误要遵循:(
I already know that its the memory management library ...
The question is:
Where can I download <sys/mman.h>
? or if there is another compiler that supports more libraries then Code::Blocks 8.02?
我已经知道它的内存管理库......问题是:我在哪里可以下载<sys/mman.h>
?或者如果有另一个支持更多库的编译器然后是 Code::Blocks 8.02?
P.S. I already linked mad.h to the compiler and tested out fine so I know there is no problem there ...
PS 我已经将 mad.h 链接到编译器并测试得很好,所以我知道那里没有问题......
回答by Pavel Minaev
Code::Blocks is not a compiler, it's an IDE. And <sys/mman.h>
is a Unix header and is not available on Windows.
Code::Blocks 不是编译器,而是 IDE。并且<sys/mman.h>
是 Unix 标头,在 Windows 上不可用。
回答by frank stallone
This is probably too late for the original poster but if anyone needs mman.h for Windows, I've found this: http://code.google.com/p/mman-win32/
这对于原始海报来说可能为时已晚,但如果有人需要 Windows 的 mman.h,我已经找到了:http: //code.google.com/p/mman-win32/
You should just be able to open it in VS (I've only done it in VS2010) and build it and then you should get what you want.
你应该能够在 VS 中打开它(我只在 VS2010 中完成过)并构建它,然后你应该得到你想要的。
回答by t0mm13b
How are you compiling the code? You might need to specify -I for specifying extra include directory which you may have to dig around on your installation /usr/local/include/sys perhaps. Also you would want to use the -L flag to specify the library that gets linked in also. Again dig around to find the correct location.
你是如何编译代码的?您可能需要指定 -I 来指定额外的包含目录,您可能需要在安装 /usr/local/include/sys 中挖掘该目录。此外,您还希望使用 -L 标志来指定也被链接的库。再次挖掘以找到正确的位置。
Hope this helps, Best regards, Tom.
希望这会有所帮助,最好的问候,汤姆。