[已解决]多个符号DllGetClassObject,DllCanUnloadNow [英] [Solved] Multiple symbols DllGetClassObject, DllCanUnloadNow

查看:512
本文介绍了[已解决]多个符号DllGetClassObject,DllCanUnloadNow的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

1>mfcs90.lib(oleexp.obj) : error LNK2005: _DllGetClassObject@12 already defined in strmbase9.lib(dllentry.obj)
1>mfcs90.lib(oleexp.obj) : error LNK2005: _DllCanUnloadNow@0 already defined in strmbase9.lib(dllentry.obj)



我该如何解决?
更新1:
有人面对过这个问题吗?
更新2:
MFC库不包含符号.
Windows SDK包含符号.

MFC库文件中也有错误:
不包括头文件的情况下会出现未定义的符号消息.

所有全局MFC函数的前缀都为"Afx"-因此不是MFC函数,或者这是有史以来最大的错误.

因此,告诉我如何处理您的错误?



How can i resolve it?
Update 1:
Has somebody faced the problem?
Update 2:
MFC library does not contain the symbols.
Windows SDK contains the symbols.

Also there is an error in MFC lib files:
without including header files occures undefined symbols message.

All global MFC function have prefix "Afx" - so that is not MFC Functions or IT IS THE BIGEST ERROR EVER PRODUCED.

So tell me what to do with your bugs?

推荐答案

似乎Microsoft也存在此错误. http://support.microsoft.com/kb/962924 [
另外,除了您提出此问题的2条结果之外,该页面还是
It seems that Microsoft has had this bug too. http://support.microsoft.com/kb/962924[^].

"You can work around this build issue by adding a call to AFX_MANAGE_STATE(AfxGetStaticModuleState()) as the first line in either InitInstance() or ExitInstance().".

Also, besides 2 results of you asking this question, that page was the top result in google[^].


根据MSDN Link2005错误可能由于以下原因而发生

•意外地与单线程和多线程库链接.确保应用程序项目文件仅包含适当的库,并且任何第三方库均已适当创建了单线程或多线程版本.

•同时使用/clr混合静态和动态库.

•符号是打包功能(通过/Gy编译创建),包含在多个文件中,但在两次编译之间进行了更改.重新编译所有包含符号的文件.

•在不同库中的两个成员对象中对符号的定义不同,并且使用了两个成员对象.

•绝对值定义了两次,每个定义中的值都不同.

•头文件声明并定义了一个变量.可能的解决方案包括:
-在.h中声明变量:extern BOOL MyBool;然后在.c或.cpp文件中为其分配:BOOL MyBool = FALSE;.
-声明变量static.
-声明变量selectany.

•如果将uuid.lib与定义GUID的其他.lib文件结合使用(例如,oledb.lib和adsiid.lib).例如:
Copyoledb.lib(oledb_i.obj):错误LNK2005:_IID_ITransactionObject
已在uuid.lib(go7.obj)
中定义
要修复,请将/FORCE:MULTIPLE添加到链接器命令行选项,并确保uuid.lib是第一个引用的库.
According to MSDN Link2005 error can occure due to following resaons

•Accidentally linking with both the single-threaded and multithreaded libraries. Ensure that the application project file includes only the appropriate libraries and that any third-party libraries have appropriately created single-threaded or multithreaded versions.

•Mixing static and dynamic libraries when also using /clr.

•The symbol is a packaged function (created by compiling with /Gy) and was included in more than one file but was changed between compilations. Recompile all files that include symbol.

•The symbol is defined differently in two member objects in different libraries, and both member objects were used.

•An absolute is defined twice, with a different value in each definition.

•A header file declared and defined a variable. Possible solutions include:
-Declare the variable in .h: extern BOOL MyBool; and then assign to it in a .c or .cpp file: BOOL MyBool = FALSE;.
-Declare the variable static.
-Declare the variable selectany.

•If you use uuid.lib in combination with other .lib files that define GUIDs (for example, oledb.lib and adsiid.lib). For example:
Copyoledb.lib(oledb_i.obj) : error LNK2005: _IID_ITransactionObject
already defined in uuid.lib(go7.obj)

To fix, add /FORCE:MULTIPLE to the linker command line options, and make sure that uuid.lib is the first library referenced.


那没有错误:
1)将DirectX的包含路径放在包含路径列表的顶部.
2)对directx的lib路径进行相同操作
问候.
Thats no error:
1) place the include path of directx on top of the list of include paths.
2) do the same with the lib path for directx
Regards.


这篇关于[已解决]多个符号DllGetClassObject,DllCanUnloadNow的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆