2

我正在尝试将我的 Qt 项目设置从 Visual Studio 2013 升级到 2015。它几乎完成了,但我在 qtmaind.lib 中遇到了一些错误。

1>qtmaind.lib(qtmain_winrt.obj) : 错误 LNK2019: 无法解析的外部符号imp__RoInitialize@4 在函数 _WinMain@16 1>qtmaind.lib(qtmain_winrt.obj) 中引用:错误 LNK2019:无法解析的外部符号 __imp__RoGetActivationFactory@12 在函数“public: __thiscall AppContainer::AppContainer(void)”中引用 (??0AppContainer@@ QAE@XZ) 1>qtmaind.lib(qtmain_winrt.obj) : error LNK2019: unresolved external symbol _WindowsCreateStringReference@16 in function "private: void __thiscall Microsoft::WRL::Wrappers::HStringReference::CreateReference(wchar_t const *, unsigned int,unsigned int)" (?CreateReference@HStringReference@Wrappers@WRL@Microsoft@@AAEXPB_WII@Z) 1>qtmaind.lib(qtmain_winrt.obj) : error LNK2019: unresolved external symbol _WindowsDeleteString@4 referenced in function "public: void __thiscall Microsoft::WRL::Wrappers::HString::Release(void)" (?Release@HString@Wrappers@WRL@Microsoft@@QAEXXZ) 1>qtmaind.lib(qtmain_winrt.obj) : error LNK2019: unresolved external symbol _WindowsGetStringRawBuffer@8 referenced in function "public: wchar_t const * __thiscall Microsoft::WRL::Wrappers::HString::GetRawBuffer(unsigned int *)const " (?GetRawBuffer@HString@Wrappers@WRL@Microsoft@@QBEPB_WPAI@Z) 1>qtmaind.lib(qtmain_winrt.obj) : 错误 LNK2019 :未解析的外部符号 _RoOriginateError@8 在函数“public: static void __cdecl Microsoft::WRL::ErrorHelper<0>::OriginateError(long,struct HSTRINGwchar_t const * __thiscall Microsoft::WRL::Wrappers::HString::GetRawBuffer(unsigned int *)const " (?GetRawBuffer@HString@Wrappers@WRL@Microsoft@@QBEPB_WPAI@Z) 1>qtmaind.lib(qtmain_winrt.obj ) : error LNK2019: unresolved external symbol _RoOriginateError@8 referenced in function "public: static void __cdecl Microsoft::WRL::ErrorHelper<0>::OriginateError(long,struct HSTRINGwchar_t const * __thiscall Microsoft::WRL::Wrappers::HString::GetRawBuffer(unsigned int *)const " (?GetRawBuffer@HString@Wrappers@WRL@Microsoft@@QBEPB_WPAI@Z) 1>qtmaind.lib(qtmain_winrt.obj ) : error LNK2019: unresolved external symbol _RoOriginateError@8 referenced in function "public: static void __cdecl Microsoft::WRL::ErrorHelper<0>::OriginateError(long,struct HSTRING*)" (?OriginateError@?$ErrorHelper@$0A@@WRL@Microsoft@@SAXJPAUHSTRING__@@@Z)

Qt 5.6-rc(2016 年 2 月 22 日 15:11)

4

2 回答 2

6

链接到 WindowsApp.lib。那应该可以解决您的问题。

于 2016-09-29T01:05:55.930 回答
2

至少要获取 GetActivationFactory,您需要链接到 runtimeobject.lib。

于 2017-08-02T00:46:16.643 回答