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

Comments

Projects
None yet
3 participants
@vnart

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

This comment has been minimized.

Show comment
Hide comment
@latticekun

latticekun Aug 27, 2012

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

latticekun commented Aug 27, 2012

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

@vnart

This comment has been minimized.

Show comment
Hide comment
@vnart

vnart Aug 27, 2012

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

vnart commented Aug 27, 2012

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

@latticekun

This comment has been minimized.

Show comment
Hide comment
@latticekun

latticekun Aug 27, 2012

thanks,I will try it...

latticekun commented Aug 27, 2012

thanks,I will try it...

@johnbinwang

This comment has been minimized.

Show comment
Hide comment
@johnbinwang

johnbinwang Aug 27, 2012

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

On Mon, Aug 27, 2012 at 11:20 AM, vnart notifications@github.com 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

johnbinwang commented Aug 27, 2012

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

On Mon, Aug 27, 2012 at 11:20 AM, vnart notifications@github.com 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

This comment has been minimized.

Show comment
Hide comment
@vnart

vnart 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.

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

This comment has been minimized.

Show comment
Hide comment
@latticekun

latticekun Aug 27, 2012

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

latticekun commented Aug 27, 2012

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

@johnbinwang

This comment has been minimized.

Show comment
Hide comment
@johnbinwang

johnbinwang Aug 27, 2012

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 notifications@github.com 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

johnbinwang commented Aug 27, 2012

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 notifications@github.com 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