我想使用c++和VS2010读取sqlite数据库文件,我正在编写以下代码。
sqlite3 *db;
int rc = sqlite3_open("test.db", &db);我得到了这样的错误
lib(MSVCR100.dll) : error LNK2005: _strncmp already defined in LIBCMTD.lib(strncmp.obj)
1>MSVCRT.lib(MSVCR100.dll) : error LNK2005: _malloc already defined in LIBCMTD.lib(dbgmalloc.obj)
1>MSVCRT.lib(MSVCR100.dll) : error LNK2005: _free already defined in LIBCMTD.lib(dbgfree.obj)
1>MSVCRT.lib(MSVCR100.dll) : error LNK2005: _realloc already defined in LIBCMTD.lib(dbgrealloc.obj)
1>MSVCRT.lib(MSVCR100.dll) : error LNK2005: _memmove already defined in LIBCMTD.lib(memmove.obj)
1>MSVCRT.lib(MSVCR100.dll) : error LNK2005: _atoi already defined in LIBCMTD.lib(atox.obj)
1>MSVCRT.lib(ti_inst.obj) : error LNK2005: "private: __thiscall type_info::type_info(class type_info const &)" (??0type_info@@AAE@ABV0@@Z) already defined in LIBCMTD.lib(typinfo.obj)
1>MSVCRT.lib(ti_inst.obj) : error LNK2005: "private: class type_info & __thiscall type_info::operator=(class type_info const &)" (??4type_info@@AAEAAV0@ABV0@@Z) already defined in LIBCMTD.lib(typinfo.obj)
1>LINK : warning LNK4098: defaultlib 'MSVCRT' conflicts with use of other libs; use /NODEFAULTLIB:library
1>output\win32\Debug\SC.exe : fatal error LNK1169: one or more multiply defined symbols found我确实在项目中包含了sqlite3.lib,并给出了路径。
发布于 2013-07-15 17:13:33
在您的项目中,您正在尝试使用C标准库的调试版本和发布(非调试)版本。
这意味着sqlite3.lib正在使用一种C标准库,而您的项目正在使用另一种标准库。您的项目和使用的库必须与Debug/Release选项以及静态/动态使用标准库选项相匹配。
https://stackoverflow.com/questions/17650533
复制相似问题