将Gecko 1.9迁移到2.0 - 很多错误

时间:2011-06-17 01:46:23

标签: gecko

好的,在我的XPCOM组件迁移到Gecko 2.0之后, 我修好了几个如下: 1.将#include“nsIGenericFactory.h”替换为#include“mozilla / ModuleUtils.h” 2.将xpcomglue_s.lib替换为xpcomglue_s_nomozalloc.lib 3.将#include“mozilla-config.h”添加到xpcom-config.h头文件中 4.以及删除一些未使用的头文件,例如:nsReadableUtils.h,nsEventQueueUtils.h,nsIExtensionManager.h 5.将NS_DEFINE_STATIC_IID_ACCESSOR(IMYPROGRAM_IID)替换为NS_DEFINE_STATIC_IID_ACCESSOR(IMyProgram,IMYPROGRAM_IID)

现在从200多个错误减少到20多个,下面是一些错误,我不知道那是什么,这里有任何专家遇到如下问题吗?

error C3254: 'IMyProgram' : class contains explicit override 'kIID' but does not derive from an interface that contains the function declaration
error C2838: 'kIID' : illegal qualified name in member declaration
error C3857: 'IMyProgram::kIID': multiple template parameter lists are not allowed
error C2084: function 'void nsTraceRefcnt::LogAddRef(void *,nsrefcnt,const char *,PRUint32)' already has a body
error C2084: function 'void nsTraceRefcnt::LogRelease(void *,nsrefcnt,const char *)' already has a body
error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
error C2143: syntax error : missing ',' before '*'
error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
error C2143: syntax error : missing ',' before '*'
error C2146: syntax error : missing ';' before identifier 'components'
error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
error C2440: 'initializing' : cannot convert from 'const char [13]' to 'int'
error C2078: too many initializers
error C2448: 'NS_IMPL_NSGETMODULE' : function-style initializer appears to be a function definition
error C2143: syntax error : missing ';' before '__stdcall'
error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
error C2143: syntax error : missing ',' before '*'
error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
error C2556: 'int MyProgramRegistration(nsIComponentManager *,nsIFile *,const char *,const char *,const int)' : overloaded function differs only by return type from 'nsresult MyProgramRegistration(nsIComponentManager *,nsIFile *,const char *,const char *,const int)'
error C2371: 'MyProgramRegistration' : redefinition; different basic types
error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
error C2143: syntax error : missing ',' before '*'
error C3254: 'IMyProgram' : class contains explicit override 'kIID' but does not derive from an interface that contains the function declaration
error C2838: 'kIID' : illegal qualified name in member declaration
error C3857: 'IMyProgram::kIID': multiple template parameter lists are not allowed

1 个答案:

答案 0 :(得分:0)

至少看起来你的界面中缺少一个NS_DECLARE_STATIC_IID_ACCESSOR(IMYPROGRAM_IID)(xpidl会自动为你生成它。)如果没有源代码,其他一些错误有点难以理解,但很可能你还没有完全正确地更新你的模块注册码。