Error LNK2005:exist already defined in msvcrt.lib(MSVCR100.dll)_LIBCMTD.lib 解决方案

来源:互联网 发布:tinycore linux有啥用 编辑:程序博客网 时间:2024/05/17 03:54

 Project -- Setting -- C/C++ -- C++ Language
Enable Run-Time Type Information(RTTI) 此项必须打勾!


http://www.cnblogs.com/chenkai/archive/2013/01/23/2873932.html

 

但现在Debug版编译ok,Release版编译报错:

Linking...
Creating library Release/DataBase.lib and object Release/DataBase.exp
CppSQLite3.obj : error LNK2001: unresolved external symbol "const type_info::`vftable'" (??_7type_info@@6B@)
DataBase.obj : error LNK2001: unresolved external symbol "const type_info::`vftable'" (??_7type_info@@6B@)
SQLite.obj : error LNK2001: unresolved external symbol "const type_info::`vftable'" (??_7type_info@@6B@)

......

 

解决方法:

Project -- Settings -- C/C++ -- Preprocessor -- Preprocessordefinitions:

Release:WIN32,NDEBUG,_WINDOWS,_WINDLL,_AFXDLL,_MBCS,_USRDLL  //把NDEBUG 选项换成_DEBUG  然后Release就能够通过了
Debug:  WIN32,_DEBUG,_WINDOWS,_WINDLL,_AFXDLL,_MBCS,_USRDLL

 

欺骗一下Release的编译器,哈哈。谁叫它不让编译通过。这叫“一山还有一山高”。