链接ACE程序出现一点问题,高手低手都请进+……

starcbh 2004-04-25 07:01:07
VC6.0+sp4使用ACE5.4静态链接库,mfc程序,链接时出错

Linking...
msvcrt.lib(MSVCRT.dll) : error LNK2005: __errno already defined in libcmt.lib(dosmap.obj)
msvcrt.lib(MSVCRT.dll) : error LNK2005: _memmove already defined in libcmt.lib(memmove.obj)
msvcrt.lib(MSVCRT.dll) : error LNK2005: _wcscat already defined in libcmt.lib(wcscat.obj)
msvcrt.lib(MSVCRT.dll) : error LNK2005: _strchr already defined in libcmt.lib(strchr.obj)
msvcrt.lib(MSVCRT.dll) : error LNK2005: _wcscpy already defined in libcmt.lib(wcscat.obj)
msvcrt.lib(MSVCRT.dll) : error LNK2005: _strcspn already defined in libcmt.lib(strcspn.obj)
msvcrt.lib(MSVCRT.dll) : error LNK2005: _wcslen already defined in libcmt.lib(wcslen.obj)
msvcrt.lib(MSVCRT.dll) : error LNK2005: _strncmp already defined in libcmt.lib(strncmp.obj)
msvcrt.lib(MSVCRT.dll) : error LNK2005: _strncpy already defined in libcmt.lib(strncpy.obj)
msvcrt.lib(MSVCRT.dll) : error LNK2005: _wcsncpy already defined in libcmt.lib(wcsncpy.obj)
msvcrt.lib(MSVCRT.dll) : error LNK2005: _strpbrk already defined in libcmt.lib(strpbrk.obj)
msvcrt.lib(MSVCRT.dll) : error LNK2005: _strrchr already defined in libcmt.lib(strrchr.obj)
msvcrt.lib(MSVCRT.dll) : error LNK2005: _strspn already defined in libcmt.lib(strspn.obj)
msvcrt.lib(MSVCRT.dll) : error LNK2005: _strstr already defined in libcmt.lib(strstr.obj)
msvcrt.lib(MSVCRT.dll) : error LNK2005: _fclose already defined in libcmt.lib(fclose.obj)
msvcrt.lib(MSVCRT.dll) : error LNK2005: __close already defined in libcmt.lib(close.obj)
msvcrt.lib(MSVCRT.dll) : error LNK2005: __open_osfhandle already defined in libcmt.lib(osfinfo.obj)
msvcrt.lib(MSVCRT.dll) : error LNK2005: _fflush already defined in libcmt.lib(fflush.obj)
msvcrt.lib(MSVCRT.dll) : error LNK2005: _vsprintf already defined in libcmt.lib(vsprintf.obj)
msvcrt.lib(MSVCRT.dll) : error LNK2005: __exit already defined in libcmt.lib(crt0dat.obj)
msvcrt.lib(MSVCRT.dll) : error LNK2005: _abort already defined in libcmt.lib(abort.obj)
msvcrt.lib(MSVCRT.dll) : error LNK2005: _atoi already defined in libcmt.lib(atox.obj)
msvcrt.lib(MSVCRT.dll) : error LNK2005: _getenv already defined in libcmt.lib(getenv.obj)
msvcrt.lib(MSVCRT.dll) : error LNK2005: __itoa already defined in libcmt.lib(xtoa.obj)
msvcrt.lib(MSVCRT.dll) : error LNK2005: _strtol already defined in libcmt.lib(strtol.obj)
msvcrt.lib(MSVCRT.dll) : error LNK2005: _strtoul already defined in libcmt.lib(strtol.obj)
msvcrt.lib(MSVCRT.dll) : error LNK2005: _calloc already defined in libcmt.lib(calloc.obj)
msvcrt.lib(MSVCRT.dll) : error LNK2005: _free already defined in libcmt.lib(free.obj)
msvcrt.lib(MSVCRT.dll) : error LNK2005: _malloc already defined in libcmt.lib(malloc.obj)
msvcrt.lib(MSVCRT.dll) : error LNK2005: _realloc already defined in libcmt.lib(realloc.obj)
msvcrt.lib(MSVCRT.dll) : error LNK2005: __isatty already defined in libcmt.lib(isatty.obj)
msvcrt.lib(MSVCRT.dll) : error LNK2005: __beginthreadex already defined in libcmt.lib(threadex.obj)
msvcrt.lib(MSVCRT.dll) : error LNK2005: __endthreadex already defined in libcmt.lib(threadex.obj)
msvcrt.lib(MSVCRT.dll) : error LNK2005: _tolower already defined in libcmt.lib(tolower.obj)
msvcrt.lib(MSVCRT.dll) : error LNK2005: __stricmp already defined in libcmt.lib(stricmp.obj)
msvcrt.lib(MSVCRT.dll) : error LNK2005: __strnicmp already defined in libcmt.lib(strnicmp.obj)
msvcrt.lib(MSVCRT.dll) : error LNK2005: _signal already defined in libcmt.lib(winsig.obj)
msvcrt.lib(MSVCRT.dll) : error LNK2005: _gmtime already defined in libcmt.lib(gmtime.obj)
msvcrt.lib(MSVCRT.dll) : error LNK2005: _localtime already defined in libcmt.lib(localtim.obj)
msvcrt.lib(MSVCRT.dll) : error LNK2005: _strftime already defined in libcmt.lib(strftime.obj)
msvcrt.lib(MSVCRT.dll) : error LNK2005: _time already defined in libcmt.lib(time.obj)
msvcrt.lib(MSVCRT.dll) : error LNK2005: __tzset already defined in libcmt.lib(tzset.obj)
msvcrt.lib(MSVCRT.dll) : error LNK2005: _mktime already defined in libcmt.lib(mktime.obj)
msvcrt.lib(MSVCRT.dll) : error LNK2005: _exit already defined in libcmt.lib(crt0dat.obj)
msvcrt.lib(MSVCRT.dll) : error LNK2005: __strdup already defined in libcmt.lib(strdup.obj)
LINK : warning LNK4098: defaultlib "msvcrt.lib" conflicts with use of other libs; use /NODEFAULTLIB:library
Release/win_test.exe : fatal error LNK1169: one or more multiply defined symbols found
Error executing link.exe.


忽略libcmt.lib,出现

Linking...
nafxcw.lib(appcore.obj) : error LNK2001: unresolved external symbol ___argv
nafxcw.lib(appcore.obj) : error LNK2001: unresolved external symbol ___argc
nafxcw.lib(filelist.obj) : error LNK2001: unresolved external symbol __mbctype
nafxcw.lib(timecore.obj) : error LNK2001: unresolved external symbol __mbctype
nafxcw.lib(apphelp.obj) : error LNK2001: unresolved external symbol __mbctype
Release/win_test.exe : fatal error LNK1120: 3 unresolved externals

搞定给100分!!!
...全文
117 29 打赏 收藏 转发到动态 举报
写回复
用AI写文章
29 条回复
切换为时间正序
请发表友善的回复…
发表回复
tanyaliji 2004-04-28
  • 打赏
  • 举报
回复
怎么感觉你的是 VB中的dll
starcbh 2004-04-28
  • 打赏
  • 举报
回复
to 回复人: Semigod() ( ) 信誉:93

能否将编译好的各个lib(还有config.h)发给我一份,我这边只有ACE_Static没错,

别的全都……

starcbh@21cn.com

非常感谢
sevencat 2004-04-28
  • 打赏
  • 举报
回复
链接的时候可能还要再加上MFC的库吧,我的makefile都是不用MFC的release版本。
Semigod 2004-04-28
  • 打赏
  • 举报
回复
连接时应该指定 /MD 参数

==> 看来用ACE的人不少啊,这实在是出乎我的意料
sevencat 2004-04-28
  • 打赏
  • 举报
回复
你用了MFC呀,没注意,不好意思。
kof99th 2004-04-28
  • 打赏
  • 举报
回复
定义_AFXDLL就没有问题了
sevencat 2004-04-28
  • 打赏
  • 举报
回复
nafxcw是什么东东,怎么我没碰到过?你是不是环境变量里面缺省用的这个库?
starcbh 2004-04-27
  • 打赏
  • 举报
回复
link /DLL /NOLOGO /OUT:dllvc\acedll.dll @C:\DOCUME~1\ADMINI~1\LOCALS~1\Temp\nma02088.
Creating library dllvc\acedll.lib and object dllvc\acedll.exp
ace_Capabilities.obj : error LNK2001: unresolved external symbol "public: int __thiscall ACE_Equal_To<class ACE_String_Base<char> >::operator()(class ACE_String_Base<char> const &,class ACE_String_Base<char> const &)const " (??R?$ACE_Equal_To@V?$ACE_String_Base@D@@@@QBEHABV?$ACE_String_Base@D@@0@Z)
ace_Capabilities.obj : error LNK2001: unresolved external symbol "public: unsigned long __thiscall ACE_Hash<class ACE_String_Base<char> >::operator()(class ACE_String_Base<char> const &)const " (??R?$ACE_Hash@V?$ACE_String_Base@D@@@@QBEKABV?$ACE_String_Base@D@@@Z)
nafxcw.lib(appcore.obj) : error LNK2001: unresolved external symbol ___argv
nafxcw.lib(appcore.obj) : error LNK2001: unresolved external symbol ___argc
nafxcw.lib(filelist.obj) : error LNK2001: unresolved external symbol __mbctype
nafxcw.lib(timecore.obj) : error LNK2001: unresolved external symbol __mbctype
nafxcw.lib(apphelp.obj) : error LNK2001: unresolved external symbol __mbctype
dllvc\acedll.dll : fatal error LNK1120: 5 unresolved externals
starcbh 2004-04-27
  • 打赏
  • 举报
回复
楼上的,不行哦……

还是出错

nafxcw.lib(appcore.obj) : error LNK2001: unresolved external symbol ___argv
nafxcw.lib(appcore.obj) : error LNK2001: unresolved external symbol ___argc
nafxcw.lib(filelist.obj) : error LNK2001: unresolved external symbol __mbctype
nafxcw.lib(timecore.obj) : error LNK2001: unresolved external symbol __mbctype
nafxcw.lib(apphelp.obj) : error LNK2001: unresolved external symbol __mbctype

连接还有了几个函数"未决的外问语法"
sharkhuang 2004-04-27
  • 打赏
  • 举报
回复
感觉你静态连接了.obj,现在又编译dll造成的重定义!你查查
starcbh 2004-04-27
  • 打赏
  • 举报
回复
jiangfb(干是一种美德) (

/nodefaultlib:libcmt.lib

我设过啦,没有用
-----------------
to xubin_sh(徐彬) ( ) 信誉:100

已指定_MT选项!!我再看看……
sevencat 2004-04-27
  • 打赏
  • 举报
回复
http://efsite.net/bbs/dvbbs/dispbbs.asp?boardid=8&id=44
我已把makefile拷到这里了。有好心人帮我测试就再好不过了。
email:meng.wang@i-zq.com
starcbh 2004-04-27
  • 打赏
  • 举报
回复
to ekun001(阿昆) ( ) 信誉:100

你config.h是怎么写的
sevencat 2004-04-27
  • 打赏
  • 举报
回复
我有ace的makefile(生成DLL,生成LIB)for vc,for mingw(不要下载cygwin),
只需把路径一改就可以编译了,
要是有人想帮我测试一下的话,email:meng.wang@i-zq.com
ekun001 2004-04-27
  • 打赏
  • 举报
回复
请问楼主一个问题,不好意思,我现在找不到懂ACE的人,
我在安装ACE环境后,编译系统文件时:
我用VC6。0编译AbstractBase.cpp时出错了,
error C2491: 'release' : definition of dllimport function not allowed
error C2491: 'is_nil' : definition of dllimport function not allowed
请问是什么问题?
starcbh 2004-04-27
  • 打赏
  • 举报
回复
???

楼上,我的ACE是static lib

我现在编译出错的是一个mfc程序,链接到aces.lib,没有编译dll啊
starcbh 2004-04-26
  • 打赏
  • 举报
回复
to 回复人: ahyf(笨笨) ( ) 信誉:96
------------------------
ACE static编译没有出错,config.h已指定使用mfc
hanxian 2004-04-26
  • 打赏
  • 举报
回复
UP
sevencat 2004-04-26
  • 打赏
  • 举报
回复
手上没有VC6,不能帮你,友情UP。
ahyf 2004-04-26
  • 打赏
  • 举报
回复
不知什么原因。
你可以试试再重新编译一次ACE
加载更多回复(9)

18,356

社区成员

发帖
与我相关
我的任务
社区描述
VC/MFC 网络编程
c++c语言开发语言 技术论坛(原bbs)
社区管理员
  • 网络编程
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

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