我正在将最新的 Gecko SDK (xulrunner-34.0.5.en-US.win32.sdk) 与 MSVS 2013 一起使用,并且我面临着链接器的严重问题(显然我不是唯一一个)。
经过各种问题的大量解决方法后,我得到了这些链接器错误:
Error 3 error LNK2001: unresolved external symbol "enum tag_nsresult __cdecl NS_TableDrivenQI(void *,struct nsID const &,void * *,struct QITableEntry const *)" (?NS_TableDrivenQI@@YA?AW4tag_nsresult@@PAXABUnsID@@PAPAXPBUQITableEntry@@@Z) C:\Users\user\Desktop\sample\sample\sample\nsSample.obj sample
Error 4 error LNK2001: unresolved external symbol "public: unsigned short const * __thiscall nsAString::BeginReading(void)const " (?BeginReading@nsAString@@QBEPBGXZ) C:\Users\user\Desktop\sample\sample\sample\nsSample.obj sample
Error 5 error LNK2001: unresolved external symbol "public: virtual enum tag_nsresult __thiscall mozilla::GenericModule::CanUnload(class nsIComponentManager *,bool *)" (?CanUnload@GenericModule@mozilla@@UAE?AW4tag_nsresult@@PAVnsIComponentManager@@PA_N@Z) C:\Users\user\Desktop\sample\sample\sample\nsSampleModule.obj sample
Error 6 error LNK2001: unresolved external symbol "public: virtual enum tag_nsresult __thiscall mozilla::GenericModule::UnregisterSelf(class nsIComponentManager *,class nsIFile *,char const *)" (?UnregisterSelf@GenericModule@mozilla@@UAE?AW4tag_nsresult@@PAVnsIComponentManager@@PAVnsIFile@@PBD@Z) C:\Users\user\Desktop\sample\sample\sample\nsSampleModule.obj sample
Error 7 error LNK2001: unresolved external symbol "public: virtual enum tag_nsresult __thiscall mozilla::GenericModule::RegisterSelf(class nsIComponentManager *,class nsIFile *,char const *,char const *)" (?RegisterSelf@GenericModule@mozilla@@UAE?AW4tag_nsresult@@PAVnsIComponentManager@@PAVnsIFile@@PBD2@Z) C:\Users\user\Desktop\sample\sample\sample\nsSampleModule.obj sample
Error 8 error LNK2001: unresolved external symbol "public: virtual enum tag_nsresult __thiscall mozilla::GenericModule::GetClassObject(class nsIComponentManager *,struct nsID const &,struct nsID const &,void * *)" (?GetClassObject@GenericModule@mozilla@@UAE?AW4tag_nsresult@@PAVnsIComponentManager@@ABUnsID@@1PAPAX@Z) C:\Users\user\Desktop\sample\sample\sample\nsSampleModule.obj sample
Error 9 error LNK2001: unresolved external symbol "public: virtual unsigned int __thiscall mozilla::GenericModule::Release(void)" (?Release@GenericModule@mozilla@@UAEIXZ) C:\Users\user\Desktop\sample\sample\sample\nsSampleModule.obj sample
Error 10 error LNK2001: unresolved external symbol "public: virtual unsigned int __thiscall mozilla::GenericModule::AddRef(void)" (?AddRef@GenericModule@mozilla@@UAEIXZ) C:\Users\user\Desktop\sample\sample\sample\nsSampleModule.obj sample
Error 11 error LNK2001: unresolved external symbol "public: virtual enum tag_nsresult __thiscall mozilla::GenericModule::QueryInterface(struct nsID const &,void * *)" (?QueryInterface@GenericModule@mozilla@@UAE?AW4tag_nsresult@@ABUnsID@@PAPAX@Z) C:\Users\user\Desktop\sample\sample\sample\nsSampleModule.obj sample
我已经从 SDK 添加了所有的 LIB 文件,但仍然没有。我从其他开发人员那里发现了类似的问题,但没有解决方案:
http://forums.mozillazine.org/viewtopic.php?f=19&t=2288909
https://bugzilla.mozilla.org/show_bug.cgi?id=682259
最后一个链接应该提供一个解决方案,但它不适用于我(以及该页面上的另一个用户)。
有没有人对此问题有任何提示/解决方案/建议?
更新:
定义后XP_WIN
,我只收到一个链接器错误:
LNK2001: unresolved external symbol "public: unsigned short const * __thiscall nsAString::BeginReading(void)const " (?BeginReading@nsAString@@QBEPBGXZ) C:\Users\user\Desktop\sample\sample\sample\nsSample.obj sample
这似乎把我和这个人带到了同一个地方:
https://bugzilla.mozilla.org/show_bug.cgi?id=682259#c7
更新2:
这与我char16_t
在 mozillaChar16.h
和 MS内部的 typedef 冲突时遇到的一个问题有关yvals.h
:
typedef wchar_t char16_t;
vs
typedef unsigned short char16_t;
我的新解决方案是定义_CHAR16T
以防止 MS headers typedef-ing char16_t
。