当我要将sqlite3连接到我的项目mfc DLL时,它导入到c#。出现错误'找到一个或多个多重定义的符号'怎么解决这个问题。
首先我包括sqlite3.h并添加sqlite3.lib,在我的项目文件夹中使用sqliteBrowser创建一个数据库到我的项目。 Dcode是我的mfc Dll项目和项目路径Dcode.dll F:\ project \ Project \ Dcode \ Dcode \
然后编写代码
sqlite3 *conn; //connection object
const char *dbname="F:\\project\\ Project \\db.s3db";//destination for DB
int s=sqlite3_open(dbname,&conn);//allocating memory to the sqlite3 object using sqlite3_open constructors
if(s==SQLITE_OK)
{
std::cout<<"Opened database successfully\n";
}
然后错误
错误115错误LNK1169:找到一个或多个多重定义的符号
错误112错误LNK2005:&#34; private:__ thiscall type_info :: type_info(class type_info const&amp;)&#34; (?? 0type_info @@ AAE @ ABV0 @@ Z)已经在libcmtd.lib(typinfo.obj)中定义了F:\ project \ Project \ Dcode \ Dcode \ MSVCRT.lib(ti_inst.obj)Dcode
错误113错误LNK2005:&#34; private:class type_info&amp; __thiscall type_info :: operator =(class type_info const&amp;)&#34; (?? 4type_info @@ AAEAAV0 @ ABV0 @@ Z)已在libcmtd.lib(typinfo.obj)中定义F:\ project \ Project \ Dcode \ Dcode \ MSVCRT.lib(ti_inst.obj)Dcode 错误109错误LNK2005:已在libcmtd.lib(loctim64.obj)中定义__localtime64_s F:\ project \ Project \ Dcode \ Dcode \ MSVCRT.lib(MSVCR100.dll)Dcode 错误110错误LNK2005:_atoi已在libcmtd.lib(atox.obj)中定义F:\ project \ Project \ Dcode \ Dcode \ MSVCRT.lib(MSVCR100.dll)Dcode 错误107错误LNK2005:_free已在libcmtd.lib(dbgfree.obj)中定义F:\ project \ Project \ Dcode \ Dcode \ MSVCRT.lib(MSVCR100.dll)Dcode 错误108错误LNK2005:_malloc已在libcmtd.lib中定义(dbgmalloc.obj)F:\ project \ Project \ Dcode \ Dcode \ MSVCRT.lib(MSVCR100.dll)Dcode 错误105错误LNK2005:_memmove已在libcmtd.lib中定义(memmove.obj)F:\ project \ Project \ Dcode \ Dcode \ MSVCRT.lib(MSVCR100.dll)Dcode 错误111错误LNK2005:_realloc已在libcmtd.lib(dbgrealloc.obj)中定义F:\ project \ Project \ Dcode \ Dcode \ MSVCRT.lib(MSVCR100.dll)Dcode 错误106错误LNK2005:_strncmp已在libcmtd.lib中定义(strncmp.obj)F:\ project \ Project \ Dcode \ Dcode \ MSVCRT.lib(MSVCR100.dll)Dcode