Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

env_posix.c:125: error: storage size of ‘ai_hints’ isn’t known #47

Open
vnart opened this issue Jul 21, 2012 · 7 comments
Open

env_posix.c:125: error: storage size of ‘ai_hints’ isn’t known #47

vnart opened this issue Jul 21, 2012 · 7 comments

Comments

@vnart
Copy link

vnart commented Jul 21, 2012

-o objs/addon/src/env_posix.o
/root/nginx_mongo/mongo-c-driver/src/env_posix.c
/root/nginx_mongo/mongo-c-driver/src/env_posix.c: In function ‘mongo_socket_connect’:
/root/nginx_mongo/mongo-c-driver/src/env_posix.c:125: error: storage size of ‘ai_hints’ isn’t known
/root/nginx_mongo/mongo-c-driver/src/env_posix.c:142: warning: implicit declaration of function ‘getaddrinfo’
/root/nginx_mongo/mongo-c-driver/src/env_posix.c:144: warning: implicit declaration of function ‘gai_strerror’
/root/nginx_mongo/mongo-c-driver/src/env_posix.c:149: error: dereferencing pointer to incomplete type
/root/nginx_mongo/mongo-c-driver/src/env_posix.c:150: error: dereferencing pointer to incomplete type
/root/nginx_mongo/mongo-c-driver/src/env_posix.c:150: error: dereferencing pointer to incomplete type
/root/nginx_mongo/mongo-c-driver/src/env_posix.c:150: error: dereferencing pointer to incomplete type
/root/nginx_mongo/mongo-c-driver/src/env_posix.c:156: error: dereferencing pointer to incomplete type
/root/nginx_mongo/mongo-c-driver/src/env_posix.c:156: error: dereferencing pointer to incomplete type
/root/nginx_mongo/mongo-c-driver/src/env_posix.c:163: error: dereferencing pointer to incomplete type
/root/nginx_mongo/mongo-c-driver/src/env_posix.c:176: warning: implicit declaration of function ‘freeaddrinfo’
/root/nginx_mongo/mongo-c-driver/src/env_posix.c:125: warning: unused variable ‘ai_hints’
make[1]: *** [objs/addon/src/env_posix.o] Error 1
make[1]: Leaving directory `/root/nginx-1.2.2'
make: *** [build] Error 2

@latticekun
Copy link

I also encountered this problem, can you get the answer?

@vnart
Copy link
Author

vnart commented Aug 27, 2012

Yes, I build the mongo-c-driver first then build nginx with the mongo-c-drive lib

@latticekun
Copy link

thanks,I will try it...

@johnbinwang
Copy link

Could you please explain your method in detail? I am also encountered this
problem.

On Mon, Aug 27, 2012 at 11:20 AM, vnart [email protected] wrote:

Yes, I build the mongo-c-driver first then build nginx with the
mongo-c-drive lib


Reply to this email directly or view it on GitHubhttps://github.com//issues/47#issuecomment-8046312.

cheers,
Johnbin Wang

@vnart
Copy link
Author

vnart commented Aug 27, 2012

use make or scons to build the mongo-c-drive lib ( refer to their website for further instruction). Then copy the lib to the right location.

Modify config for nginx-gridfs to:
NGX_ADDON_SRCS="$NGX_ADDON_SRCS $ngx_addon_dir/ngx_http_gridfs_module.c "
NGX_ADDON_DEPS="$NGX_ADDON_DEPS $ngx_addon_dir/mongo-c-driver/src/*.h"

CFLAGS="$CFLAGS --std=c99 -I src -I /usr/local/include -L /usr/local/lib -lmongoc "

Then build nginx with --add-module=/root/july2012/gridfs/ --with-ld-opt=-lmongoc

Should give you no error at all. However, the current version of nginx-grifs does not work well with replica set when the primary went offline. I had to make some change to the nginx-grifs source code to make it force reconnect the connection to detect the primary has change.

One more thing, have to use nginx restart for nginx-grifs to work other. If use reload it will cause problem and nginx just quit.

@latticekun
Copy link

it was done by your way! it works well! thank you very much! @vnart

@johnbinwang
Copy link

Thank you vnart, it works! The images fetched by nginx-grifs can be cached
now.

On Mon, Aug 27, 2012 at 4:07 PM, vnart [email protected] wrote:

use make or scons to build the mongo-c-drive lib ( refer to their website
for further instruction). Then copy the lib to the right location.

Modify config for nginx-gridfs to:
NGX_ADDON_SRCS="$NGX_ADDON_SRCS $ngx_addon_dir/ngx_http_gridfs_module.c "
NGX_ADDON_DEPS="$NGX_ADDON_DEPS $ngx_addon_dir/mongo-c-driver/src/*.h"

CFLAGS="$CFLAGS --std=c99 -I src -I /usr/local/include -L /usr/local/lib
-lmongoc "

Then build nginx with --add-module=/root/july2012/gridfs/
--with-ld-opt=-lmongoc

Should give you no error at all. However, the current version of
nginx-grifs does not work well with replica set when the primary went
offline. I had to make some change to the nginx-grifs source code to make
it force reconnect the connection to detect the primary has change.

One more thing, have to use nginx restart for nginx-grifs to work other.
If use reload it will cause problem and nginx just quit.


Reply to this email directly or view it on GitHubhttps://github.com//issues/47#issuecomment-8049427.

cheers,
Johnbin Wang

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants