When compiling the mongoDB C driver, I get this message:
scons --c99
scons: Reading SConscript files ...
Checking for C library json... no
scons: done reading SConscript files.
scons: Building targets ...
gcc -o src/md5.o -c -std=c99 -pedantic -Wall -ggdb -DMONGO_HAVE_STDINT -O3 -I/opt/local/include -Isrc src/md5.c
gcc -o src/mongo.o -c -std=c99 -pedantic -Wall -ggdb -DMONGO_HAVE_STDINT -O3 -I/opt/local/include -Isrc src/mongo.c
src/mongo.c: In function 'mongo_conn_set_timeout':
src/mongo.c:437:20: error: storage size of 'tv' isn't known
src/mongo.c:437:20: warning: unused variable 'tv' [-Wunused-variable]
The reason for this is that "struct timeval tv" is not defined by default. <sys/time.h> is not included in mongo.c, and thus causes the compiling process to terminate with the above error. Attached is a modified version of mongo.c that has two lines, a comment line and #include <sys/time.h>