mdirolf / nginx-gridfs

Nginx module for serving files from MongoDB's GridFS

Home Page:http://www.mongodb.org

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

nginx-gridfs failed to build on gentoo

RFDAJE opened this issue · comments

building the module followed the README instruction, then it failed with the following error:

gcc -c -pipe  -O -W -Wall -Wpointer-arith -Wno-unused-parameter -Wunused-function -Wunused-variable -Wunused-value -Werror -g  --std=c99 -Isrc  -I src/core -I src/event -I src/event/modules -I src/os/unix -I objs -I src/http -I src/http/modules -I src/mail \
                -o objs/addon/src/gridfs.o \
                /src/git/nginx-gridfs//mongo-c-driver/src/gridfs.c
cc1: warnings being treated as errors
/src/git/nginx-gridfs//mongo-c-driver/src/gridfs.c: In function ‘gridfile_write_file’:
/src/git/nginx-gridfs//mongo-c-driver/src/gridfs.c:603: error: ignoring return value of ‘fwrite’, declared with attribute warn_unused_result
make[1]: *** [objs/addon/src/gridfs.o] Error 1
make[1]: Leaving directory `/src/git/nginx-gridfs/nginx-0.8.53'
make: *** [build] Error 2

it seems that the problem comes from file gridfs.c, the fwrite() function on line 603, so I commented out the whole "gridfile_write_file" code block, then I can successfully build the module without problem, but I think this is barely a solution or a fix, and the built nginx will not be able to write file to gridfs, so I hope someone could give me some hints how to build the whole thing on my gentoo system.

PS:
kernel-2.6.34
gcc-4.4.4
boost-1.42.0
openssl-1.0.0
nginx-0.8.53
nginx-gridfs git latest

thx a lot.

maybe try compiling without Werror? or could try patching the code so as not to ignore that return value..

after append "-Wno-error" to CFLAGS, the compilation did't break anymore, thx.

this can be closed