添加链接
link之家
链接快照平台
  • 输入网页链接,自动生成快照
  • 标签化管理网页链接
Collectives™ on Stack Overflow

Find centralized, trusted content and collaborate around the technologies you use most.

Learn more about Collectives

Teams

Q&A for work

Connect and share knowledge within a single location that is structured and easy to search.

Learn more about Teams

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 :

sys/mman.h: No such file or directory and of course a bunch of errors to follow :(

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?

P.S. I already linked mad.h to the compiler and tested out fine so I know there is no problem there ...

@Pavel Minaev: in fact if you specify <sys/mman.h> under windows it will still pull in the definitions and declarations, that is, provided the code has been ported to win32 platform...by doing #include <sys/mman.h> or any other header file, does not necessarily imply it is unix based because of a forward slash is used. Hope that helps! :) t0mm13b Nov 27, 2009 at 21:00 @tommieb, this has nothing to do with forward slash and everything to do with the fact that all headers under sys are traditional Unix APIs. Windows implementations normally provide a few of them - those that are easy to implement, such as sys/stat.h or sys/utime.h - but not all. The only implementations that might provide mman.h is Cygwin and Interix (SFU/SUA). Pavel Minaev Nov 27, 2009 at 21:22

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.

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.

Hope this helps, Best regards,

WSL or Windows Subsystem for Linux is a great way to develop c programs in a native environment but within windows.

https://learn.microsoft.com/en-us/windows/wsl/install

I know this is years late but I hope someone finds it useful like I have.

Thanks for contributing an answer to Stack Overflow!

  • Please be sure to answer the question . Provide details and share your research!

But avoid

  • Asking for help, clarification, or responding to other answers.
  • Making statements based on opinion; back them up with references or personal experience.

To learn more, see our tips on writing great answers .