"sys/mman.h:没有这样的文件或目录"

Moh*_*med 7 c++ visual-c++

我正在使用Code :: Blocks 8.02,我有一个问题..每次我尝试编译minimad.c(Libmad附带的示例)我收到一条错误消息:

sys/mman.h: No such file or directory 当然还有一堆错误:(

我已经知道它的内存管理库...问题是:我在哪里可以下载<sys/mman.h>?或者如果有另一个编译器支持更多库,那么Code :: Blocks 8.02?

PS我已经将mad.h链接到编译器并进行了测试,所以我知道那里没有问题...

Pav*_*aev 8

Code :: Blocks不是编译器,而是IDE.并且<sys/mman.h>是一个Unix标头,在Windows上不可用.

  • @tommieb,这与正斜杠无关,而且与`sys`下的所有头文件都是传统的Unix API这一事实有关.Windows实现通常提供其中的一些 - 易于实现的那些,例如`sys/stat.h`或`sys/utime.h` - 但不是全部.可能提供`mman.h`的唯一实现是Cygwin和Interix(SFU/SUA). (6认同)
  • @Pavel Minaev:事实上,如果你在windows下指定<sys/mman.h>它仍会引入定义和声明,也就是说,只要代码已经被移植到win32平台......通过#include <sys/mman.h>或任何其他头文件,并不一定意味着它是基于unix的,因为使用了正斜杠.希望有所帮助!:) (2认同)

fra*_*one 5

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/

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.