Hi, I have a problem when I compile Samba 2.0.3, the next error message is generated doing "make": Using LIBS Compiling locking/shmem.c locking/shmem.c: In function `smb_shm_open': locking/shmem.c:921: `PROT_READ' undeclared (first use this function) locking/shmem.c:921: (Each undeclared identifier is reported only once locking/shmem.c:921: for each function it appears in.) locking/shmem.c:921: `PROT_WRITE' undeclared (first use this function) locking/shmem.c:922: `MAP_SHARED' undeclared (first use this function) make: *** [locking/shmem.o] Error 1 The "configure" is OK, my Linux Kernel is 2.0.35 and my gcc is 2.8.1, It is the first time that I have a problem when I compile. Please I need HELP Jose Miguel Rubio jrubio@edei.es
On 17 Apr 99, jrubio <jrubio@edei.es> had questions about Problems compiling Samba 2.0.3:> I have a problem when I compile Samba 2.0.3, the next error message is > generated doing "make": > > Using LIBS > Compiling locking/shmem.c > locking/shmem.c: In function `smb_shm_open': > locking/shmem.c:921: `PROT_READ' undeclared (first use this function) > locking/shmem.c:921: (Each undeclared identifier is reported only once > locking/shmem.c:921: for each function it appears in.) > locking/shmem.c:921: `PROT_WRITE' undeclared (first use this function) > locking/shmem.c:922: `MAP_SHARED' undeclared (first use this function) > make: *** [locking/shmem.o] Error 1 > > The "configure" is OK, my Linux Kernel is 2.0.35 and my gcc is 2.8.1, It > is the first time that I have a problem when I compile.It sure looks like you're missing a header file where the above identifiers are declared. I'm certainly no C whiz (although I *did* get an A in my one and only C class last semester - I had a good teacher); it's either missing from the samba source or your gcc libs. Check and see where your gcc is reading the specs from; maybe it's looking in the wrong place. Are you running linux, and if so, what kernel? I'll poke around on my system and see what I can find. Steve ************************************************************* Steve Arnold http://www.rain.org/~sarnold "A mime is a terrible thing to waste..." Mel Brooks
On 18 Apr 99, Jan Kratochvil <short@ucw.cz> had this to say about Problems compiling Samba 2.0.3:> As I see the thread growing about pointless problem, attached is a hack > diff to fix it. But either "jrubio" has system on fire or the new > configure system is not flexible enough and should be updated.I was hoping someone knowledgeable would bail me out of this one 8-) After poking around on my system at home, I found the following references to MAP_SHARED: In samba source: server.c: PROT_READ,MAP_SHARED,fsp->fd_ptr->fd,0); shmem.c: MAP_FILE | MAP_SHARED, Nothing in the include files in the samba source, but I did find the following in the linux source tree: in /usr/src/linux-2.0.36/include/asm-i386/ mman.h:#define MAP_SHARED 0x01 /* Share changes */ in /usr/src/linux-2.0.36/mm/ mmap.c: * MAP_SHARED r: (no) no r: (yes) yes r: (no) yes r: (no) yes mmap.c: case MAP_SHARED: mmap.c: if (flags & MAP_SHARED) { nothing in /usr/lib/gcc-lib/i386-redhat-linux/2.7.2.3/ or /usr/lib/gcc-lib/i386-redhat-linux/egcs-2.90.29/ So I'd guess you don't have the kernel-headers installed (either that, or it really is on fire:) I haven't used gcc 2.8.1 under linux yet, but it seems to work fine on win32 (no header or lib problems yet anyway). Have you compiled a kernel on this system? If not, you should. It'll tell you whether your includes are setup right, and also detect problem hardware (through the dreaded sig11, sig6, etc). The patch is a kind of a "quick and dirty" fix (no offense;). It's probably better to find and fix the root of the problem (otherwise it'll just bite you somewhere else later). Hope this helps, Steve ************************************************************* Steve Arnold http://www.rain.org/~sarnold Conserving bandwidth (and belly-button lint...)