0
我得到的錯誤錯誤LNK2005:無效__cdecl蒙戈:: uasserted(...)已經定義
mongoclient.lib(assert_util.obj) : error LNK2005: void __cdecl mongo::uasserted(...) already defined in someOwnFile.obj
在鏈接,與mongo::msgasserted
和mongo::msgasserted
一起。
在someOwnFile.cpp
,我有
#include <string>
#ifdef WIN32
// Needed for mongo BSON.
#pragma warning(push)
#pragma warning(disable: 4800)
#pragma warning(disable: 4244)
#pragma warning(disable: 4267)
#define _CRT_SECURE_NO_WARNINGS 1
#endif
#include <mongo/bson/bson.h>
#ifdef WIN32
#pragma warning(pop)
#endif
// ...
爲什麼會出錯?我該如何解決它?