诚请看看这个编译连接错误的问题.

allen_zhaozhencn 2005-01-25 04:47:13
项目: MFC SDI (win32-debug, MFC dynamic link) , 静态连接: cryptlib.lib

编译老是出现下面的问题. (我另外新建一个console 程序,静态连接: cryptlib.lib, 程序正常运行)

-------------------Configuration: GS - Win32 Debug--------------------
Linking...
msvcprtd.lib(MSVCP60D.dll) : error LNK2005: "public: __thiscall std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >(char const *,class basic_
string<char,struct std::char_traits<char>,class std::allocator<char> >::allocator<char> const &)" (??0?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QAE@PBDABV?$allocator@D@1@@Z) already defined in cryptlib.lib(winpipes.obj)
msvcprtd.lib(MSVCP60D.dll) : error LNK2005: "public: __thiscall std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >::~basic_string<char,struct std::char_traits<char>,class std::allocator<char> >(void)" (??1?$basic_strin
g@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QAE@XZ) already defined in cryptlib.lib(winpipes.obj)
msvcprtd.lib(MSVCP60D.dll) : error LNK2005: "public: class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > & __thiscall std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >::operator=(cl
ass std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const &)" (??4?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QAEAAV01@ABV01@@Z) already defined in cryptlib.lib(winpipes.obj)
msvcprtd.lib(MSVCP60D.dll) : error LNK2005: "public: __thiscall std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >(class basic_string<char,s
truct std::char_traits<char>,class std::allocator<char> >::allocator<char> const &)" (??0?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QAE@ABV?$allocator@D@1@@Z) already defined in cryptlib.lib(winpipes.obj)
msvcprtd.lib(MSVCP60D.dll) : error LNK2005: "public: __thiscall std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >(class basic_string<char,s
truct std::char_traits<char>,class std::allocator<char> >::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const &)" (??0?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QAE@ABV01@@Z) already defined in crypt
lib.lib(winpipes.obj)
msvcprtd.lib(MSVCP60D.dll) : error LNK2005: "public: __thiscall std::bad_cast::bad_cast(char const *)" (??0bad_cast@std@@QAE@PBD@Z) already defined in cryptlib.lib(integer.obj)
msvcprtd.lib(MSVCP60D.dll) : error LNK2005: "public: virtual __thiscall std::bad_cast::~bad_cast(void)" (??1bad_cast@std@@UAE@XZ) already defined in cryptlib.lib(integer.obj)

std@@QBEIXZ) already defined in cryptlib.lib(winpipes.obj)
msvcprtd.lib(MSVCP60D.dll) : error LNK2005: "public: unsigned int __thiscall std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >::size(void)const " (?size@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QBE
IXZ) already defined in cryptlib.lib(winpipes.obj)
msvcprtd.lib(MSVCP60D.dll) : error LNK2005: "public: char const * __thiscall std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >::data(void)const " (?data@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QBE
PBDXZ) already defined in cryptlib.lib(asn.obj)


LIBCMTD.lib(crt0init.obj) : error LNK2005: ___xi_a already defined in msvcrtd.lib(cinitexe.obj)
LIBCMTD.lib(winxfltr.obj) : error LNK2005: __XcptFilter already defined in msvcrtd.lib(MSVCRTD.dll)
LIBCMTD.lib(tolower.obj) : error LNK2005: _tolower already defined in msvcrtd.lib(MSVCRTD.dll)
LIBCMTD.lib(fflush.obj) : error LNK2005: _fflush already defined in msvcrtd.lib(MSVCRTD.dll)
msvcrtd.lib(MSVCRTD.dll) : error LNK2005: _calloc already defined in LIBCMTD.lib(dbgheap.obj)
msvcrtd.lib(MSVCRTD.dll) : error LNK2005: _atol already defined in LIBCMTD.lib(atox.obj)
msvcrtd.lib(MSVCRTD.dll) : error LNK2005: _atoi already defined in LIBCMTD.lib(atox.obj)
msvcrtd.lib(MSVCRTD.dll) : error LNK2005: __setmbcp already defined in LIBCMTD.lib(mbctype.obj)
LINK : warning LNK4098: defaultlib "msvcrtd.lib" conflicts with use of other libs; use /NODEFAULTLIB:library
LINK : warning LNK4098: defaultlib "LIBCMTD" conflicts with use of other libs; use /NODEFAULTLIB:library
LIBCMTD.lib(crt0.obj) : error LNK2001: unresolved external symbol _main
../debug/GS.exe : fatal error LNK1120: 1 unresolved externals
Error executing link.exe.

GS.exe - 51 error(s), 2 warning(s)
...全文
156 18 打赏 收藏 转发到动态 举报
写回复
用AI写文章
18 条回复
切换为时间正序
请发表友善的回复…
发表回复
ppddt008 2005-01-26
  • 打赏
  • 举报
回复
友情帮顶!
乖乖!
10water 2005-01-26
  • 打赏
  • 举报
回复
友情帮顶!
逍遥浪子!
sharkhuang 2005-01-26
  • 打赏
  • 举报
回复
都用动态多线程库!肯定是你库冲突!所以你用depends看看
oyljerry 2005-01-26
  • 打赏
  • 举报
回复
静态连接试过了.也不行.
----------------------什么问题?
iamltq 2005-01-26
  • 打赏
  • 举报
回复
把一些引起redefined 的library忽略掉,试试看
allen_zhaozhencn 2005-01-26
  • 打赏
  • 举报
回复
to: oyljerry(☆勇敢的心☆→㊣Project Coding㊣)
静态连接试过了.也不行.
allen_zhaozhencn 2005-01-26
  • 打赏
  • 举报
回复
多谢各位.稍后结贴.
kingzai 2005-01-25
  • 打赏
  • 举报
回复
Cryptest (MFC Style Crypto++ v4.2 Library GUI).
http://www.codeproject.com/samples/cryptest__mfc_style_.asp
oyljerry 2005-01-25
  • 打赏
  • 举报
回复
可以把SDI改用静态 use MFC in a static library编译试试
oyljerry 2005-01-25
  • 打赏
  • 举报
回复
项目: MFC SDI (win32-debug, MFC dynamic link) , 静态连接: cryptlib.lib
一个用的动态连接,一个静态连接,库冲突
都用静态连接试试
ppddt008 2005-01-25
  • 打赏
  • 举报
回复
帮up
allen_zhaozhencn 2005-01-25
  • 打赏
  • 举报
回复
有没有同志在mfc中使用Crypto++的经历?
koko1998 2005-01-25
  • 打赏
  • 举报
回复
gz
qrlvls 2005-01-25
  • 打赏
  • 举报
回复
agree to DentistryDoctor
bobob 2005-01-25
  • 打赏
  • 举报
回复
就是说,这两个库不能同时用
DentistryDoctor 2005-01-25
  • 打赏
  • 举报
回复
项目: MFC SDI (win32-debug, MFC dynamic link) , 静态连接: cryptlib.lib
项目是动态链接的,那么不能连接静态链接库。
bobob 2005-01-25
  • 打赏
  • 举报
回复
msvcprtd.lib和cryptlib.lib定义的符号名字有冲突
allen_zhaozhencn 2005-01-25
  • 打赏
  • 举报
回复
cryptlib.lib是一个套加密库.

16,472

社区成员

发帖
与我相关
我的任务
社区描述
VC/MFC相关问题讨论
社区管理员
  • 基础类社区
  • Web++
  • encoderlee
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告

        VC/MFC社区版块或许是CSDN最“古老”的版块了,记忆之中,与CSDN的年龄几乎差不多。随着时间的推移,MFC技术渐渐的偏离了开发主流,若干年之后的今天,当我们面对着微软的这个经典之笔,内心充满着敬意,那些曾经的记忆,可以说代表着二十年前曾经的辉煌……
        向经典致敬,或许是老一代程序员内心里面难以释怀的感受。互联网大行其道的今天,我们期待着MFC技术能够恢复其曾经的辉煌,或许这个期待会永远成为一种“梦想”,或许一切皆有可能……
        我们希望这个版块可以很好的适配Web时代,期待更好的互联网技术能够使得MFC技术框架得以重现活力,……

试试用AI创作助手写篇文章吧