tags:

views:

551

answers:

2

Hi ; 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 ...

+3  A: 

Code::Blocks is not a compiler, it's an IDE. And <sys/mman.h> is a Unix header and is not available on Windows.

Pavel Minaev
@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! :)
tommieb75
@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
A: 

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, Tom.

tommieb75