سؤال

I'm totally newbie in UNIX project compiling. I need help or advice in using of Cygwin. An errors on "MAKE" command make me upset:

/player_module.cpp:96: undefined reference to `mmap'
/player_module.cpp:136: undefined reference to `munmap'

player_module.cpp has includes:

#include <stdio.h>
#include <string.h>
#include <sys/mman.h>

Invocation code looks like:

dump_start = mmap( NULL, sb.st_size, PROT_READ, MAP_SHARED, fileno( file ), 0 );
munmap( dump_start, sb.st_size );

As far as I understand the problem is with sys/mman.h include, but I don't have any clue how to resolve it. Any help would be appreciated.

PS. I don't know anything about UNIX, GCC or things like that, because I do only windows stuff.

هل كانت مفيدة؟

المحلول

You should add -lrt to your link command.

مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top