我有一个很大的问题,
我有一些使用 ZeroMQ 和 C 的代码,以及另一个使用 MongoDB 和 C 的代码,现在我必须合并这些代码,但是当我尝试使用此命令进行编译时:
gcc -static -lzmq -o logg logger.c /home/lis/mongo-c-driver/libmongoc.a
我得到了这个错误堆栈:
In file included from /usr/local/include/mongo.h:24:0,
from write_log.h:13,
from get_by_log_code.h:6,
from logger.c:23:
/usr/local/include/bson.h:63:2: error: #error Must compile with c99 or define MONGO_HAVE_STDINT, MONGO_HAVE_UNISTD, MONGO_USE__INT64, or MONGO_USE_LONG_INT.
In file included from get_by_log_code.h:6:0,
from logger.c:23:
write_log.h: In function ‘write_log’:
write_log.h:70:2: error: incompatible type for argument 1 of ‘mongo_insert’
/usr/local/include/mongo.h:369:18: note: expected ‘struct mongo *’ but argument is of type ‘mongo’
write_log.h:70:2: error: too few arguments to function ‘mongo_insert’
/usr/local/include/mongo.h:369:18: note: declared here
当我安装 Mongo-C-Driver 时:
我使用 make STD=c89 来解决 MongoDB-C-api 和 ZeroMQ-C-api 之间的冲突,在我的 logger.c 文件中我定义了错误堆栈要求的变量,但它不起作用.