构建c驱动程序时出错

时间:2012-05-21 11:04:35

标签: c visual-studio mongodb driver

我下载了源代码和SCONS工具。然后我尝试运行“scons”来构建,但构建失败并带有以下输出:

scons: Reading SConscript files ...
Compiling for amd64
Checking for C type int64_t... (cached) no
Checking for C type int64_t... (cached) yes
Checking for C library json... (cached) no

scons: warning: Two different environments were specified for target bson.lib,
        but they appear to have the same action: ${TEMPFILE('$AR $ARFLAGS /OUT:$TARGET $SOURCES')}
File "D:\c\mongodb-win32-x86_64-2.0.4\mongodb-mongo-c-driver-8f3bf8e\SConstruct", line 170, in <modu
le>
scons: done reading SConscript files.
scons: Building targets ...
link /nologo /dll /out:mongoc.dll /implib:mongoc.lib ws2_32.lib src\md5.obj src\mongo.obj src\env_wi
n32.obj src\gridfs.obj src\bson.obj src\numbers.obj src\encoding.obj
env_win32.obj : error LNK2005: mongo_clear_errors 已经在 mongo.obj 中定义
   正在创建库 mongoc.lib 和对象 mongoc.exp
mongoc.dll : fatal error LNK1169: 找到一个或多个多重定义的符号
scons: *** [mongoc.dll] Error 1169
scons: building terminated because of errors.

关键信息表示:在关联时,发现mongo_clear_errors被定义了多次,定义位于mongo.cenv_win32.c

如何清除此错误?我正在使用win7 64位的visual studio 2011。

谢谢大家。

0 个答案:

没有答案