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
Compilation issue. on ubuntu - 12.04. mongodb driver is installed. #331
Comments
Hello, I followed part of this problem in github perfwatcher/perfwatcher issue #31. I redirected @sseshachala here because there is no modification of the code related to mongodb in the patchs we provide for collectd to work better with perfwatcher. I think I will not help too much (I do not use mongodb), but maybe the answer of those 2 questions may help others to help you :
Regards, |
Hi, "implicit declaration" means that the function is being used (called) but that it was not declared. The declaration should happen in the appropriate header file, so either a header file is missing or we need to include an additional header file on Ubuntu. Anyway, this hints at a compile time issue. The first line you posted, however, suggest that your problem appears at link time. Can you please search for the bson_create function in your header files, e.g. with: Also, please provide a bit more context, e.g. the 20 lines leading up to the error. Thanks and best regards, |
Hi, below is my installation process:
and here all works fine, but when i run make && make install, it caused errorf as belows:
Thanks. |
I'm pretty sure the cause is that The Please look through the Best regards, |
The issue is that the api changed in 0.8.0 https://github.com/mongodb/mongo-c-driver/blob/master/HISTORY.md#08 renaming the function to bson_alloc |
According to the mongo-c-driver 0.8.1 documentation, each call to bson_alloc() needs to be matched by a call to bson_dealloc() and each call to bson_init() needs to be matched by a call to bson_destroy(). Additionally, this patch adds macros for mongo-c-driver < 0.8.0 to map the new bson_alloc() and bson_deallow() names to the old bson_create() and bson_dispose() symbol names. Tested with mongo-c-driver 0.8.1 and 0.7.1. Fixes: #331, #956
This latest patch adds compatibility for (at least) mongo-c-driver 0.8.1 and 0.7.1. However, the driver has been completely rewritten it seems, with even more API and ABI changes. This will be a matter for a new feature release, though. |
libtool: link: gcc -Wall -Werror -g -O2 -o .libs/collectd-nagios collectd_nagios-collectd-nagios.o libcollectdclient/.libs/libcollectdclient.so -L/usr/lib -L/lib/x86_64-linux-gnu -lgcrypt -ldl
write_mongodb.c:77:3: error: implicit declaration of function ‘bson_create’ [-Werror=implicit-function-declaration]
write_mongodb.c:77:7: error: assignment makes pointer from integer without a cast [-Werror]
write_mongodb.c: In function ‘wm_write’:
write_mongodb.c:246:3: error: implicit declaration of function ‘bson_dispose’ [-Werror=implicit-function-declaration
Can some one shed some light?
The text was updated successfully, but these errors were encountered: