2

我已经下载了源代码和 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.c和中env_win32.c

如何消除此错误?我正在使用 64 位 win7 的 Visual Studio 2011。

谢谢大家。

4

0 回答 0