将WinRT组件链接到我的游戏时出错! [英] Error linking WinRT component to my game!

查看:105
本文介绍了将WinRT组件链接到我的游戏时出错!的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的游戏中的主要重大问题!!帮忙!

Major major major problems with my game!! Help!!

我已经这样创建了Windows运行时组件:

I have created a Windows Runtime Component as thus:

ref class KernelBase abstract : public Windows::ApplicationModel::Core::IFrameworkView
		{
		public:
			virtual void Initialize(Windows::ApplicationModel::Core::CoreApplicationView^ applicationView);
			virtual void SetWindow(Windows::UI::Core::CoreWindow^ window);
			virtual void Load(Platform::String^ entryPoint);
			virtual void Run();
			virtual void Uninitialize();

			virtual void OnStart() = 0;
			virtual void OnStop() = 0;
			virtual void OnFrame(float deltaTime) = 0;

			void OnActivated(Windows::ApplicationModel::Core::CoreApplicationView^ applicationView, Windows::ApplicationModel::Activation::IActivatedEventArgs^ args);
			void OnSuspending(Platform::Object^ sender, Windows::ApplicationModel::SuspendingEventArgs^ args);
			void OnResuming(Platform::Object^ sender, Platform::Object^ args);
			void OnWindowClosed(Windows::UI::Core::CoreWindow^ sender, Windows::UI::Core::CoreWindowEventArgs^ args);
			void OnVisibilityChanged(Windows::UI::Core::CoreWindow^ sender, Windows::UI::Core::VisibilityChangedEventArgs^ args);
			void OnPointerPressed(Windows::UI::Core::CoreWindow^ sender, Windows::UI::Core::PointerEventArgs^ args);
			void OnPointerMoved(Windows::UI::Core::CoreWindow^ sender, Windows::UI::Core::PointerEventArgs^ args);
			void OnPointerReleased(Windows::UI::Core::CoreWindow^ sender, Windows::UI::Core::PointerEventArgs^ args);
			void OnOrientationChanged(Platform::Object^ sender);

		internal:
			bool WindowClosed;
			bool WindowVisible;
		};

编译无误,并创建一个LIB,WINMD和DLL.

Compiles without errors and creates a LIB, WINMD and DLL.

然后,我创建一个Windows Phone Native游戏.我通过项目中的引用"属性引用WINMD文件,同时也添加了指向LIB的链接.然后,我创建一个类并按如下方式继承KernelBase:

Then I create a Windows Phone Native game. I reference the WINMD file via the Reference properties in the Project, I add a link to the LIB as well. Then I create a class and inherit KernelBase as thus:

ref class Kernel sealed : Clarity::Core::KernelBase
{
public:
	virtual void OnStart() override;
	virtual void OnStop() override;
	virtual void OnFrame(float deltaTime) override;
};

但是...当我编译时,出现以下错误:

But... when I compile, I get the following errors:

TestSuite.obj : error LNK2019: unresolved external symbol "public: virtual void __cdecl Clarity::Core::KernelBase::[Windows::ApplicationModel::Core::IFrameworkView]::Load(class Platform::String ^)" (?Load@?QIFrameworkView@Core@ApplicationModel@Windows@@KernelBase@2Clarity@@U$AAAXP$AAVString@Platform@@@Z) referenced in function "[thunk]:public: virtual void __cdecl Clarity::Core::KernelBase::[Windows::ApplicationModel::Core::IFrameworkView]::Load`adjustor{4}' (class Platform::String ^)" (?Load@?QIFrameworkView@Core@ApplicationModel@Windows@@KernelBase@2Clarity@@W3$AAAXP$AAVString@Platform@@@Z)
2>TestSuite.obj : error LNK2019: unresolved external symbol "public: virtual void __cdecl Clarity::Core::KernelBase::[Windows::ApplicationModel::Core::IFrameworkView]::Uninitialize(void)" (?Uninitialize@?QIFrameworkView@Core@ApplicationModel@Windows@@KernelBase@2Clarity@@U$AAAXXZ) referenced in function "[thunk]:public: virtual void __cdecl Clarity::Core::KernelBase::[Windows::ApplicationModel::Core::IFrameworkView]::Uninitialize`adjustor{4}' (void)" (?Uninitialize@?QIFrameworkView@Core@ApplicationModel@Windows@@KernelBase@2Clarity@@W3$AAAXXZ)
2>TestSuite.obj : error LNK2019: unresolved external symbol "public: virtual void __cdecl Clarity::Core::KernelBase::[Windows::ApplicationModel::Core::IFrameworkView]::Run(void)" (?Run@?QIFrameworkView@Core@ApplicationModel@Windows@@KernelBase@2Clarity@@U$AAAXXZ) referenced in function "[thunk]:public: virtual void __cdecl Clarity::Core::KernelBase::[Windows::ApplicationModel::Core::IFrameworkView]::Run`adjustor{4}' (void)" (?Run@?QIFrameworkView@Core@ApplicationModel@Windows@@KernelBase@2Clarity@@W3$AAAXXZ)
2>TestSuite.obj : error LNK2019: unresolved external symbol "public: virtual void __cdecl Clarity::Core::KernelBase::[Windows::ApplicationModel::Core::IFrameworkView]::Initialize(class Windows::ApplicationModel::Core::CoreApplicationView ^)" (?Initialize@?QIFrameworkView@Core@ApplicationModel@Windows@@KernelBase@2Clarity@@U$AAAXP$AAVCoreApplicationView@234@@Z) referenced in function "[thunk]:public: virtual void __cdecl Clarity::Core::KernelBase::[Windows::ApplicationModel::Core::IFrameworkView]::Initialize`adjustor{4}' (class Windows::ApplicationModel::Core::CoreApplicationView ^)" (?Initialize@?QIFrameworkView@Core@ApplicationModel@Windows@@KernelBase@2Clarity@@W3$AAAXP$AAVCoreApplicationView@234@@Z)
2>TestSuite.obj : error LNK2019: unresolved external symbol "public: virtual void __cdecl Clarity::Core::KernelBase::[Windows::ApplicationModel::Core::IFrameworkView]::SetWindow(class Windows::UI::Core::CoreWindow ^)" (?SetWindow@?QIFrameworkView@Core@ApplicationModel@Windows@@KernelBase@2Clarity@@U$AAAXP$AAVCoreWindow@2UI@4@@Z) referenced in function "[thunk]:public: virtual void __cdecl Clarity::Core::KernelBase::[Windows::ApplicationModel::Core::IFrameworkView]::SetWindow`adjustor{4}' (class Windows::UI::Core::CoreWindow ^)" (?SetWindow@?QIFrameworkView@Core@ApplicationModel@Windows@@KernelBase@2Clarity@@W3$AAAXP$AAVCoreWindow@2UI@4@@Z)
2>C:\Users\Christoffer\Documents\Frostskin Games\Code\WinRT\Clarity\ARM\Debug\TestSuite\TestSuite.exe : fatal error LNK1120: 5 unresolved externals


没有道理..不可能链接到WINRT组件吗?必须缺少某些内容,但是由于没有关于如何执行此操作的真实文档(链接已死),我无法弄清楚.


Makes no sense.. is it not possible to link to WINRT Components? Something must be missing, but I cannot figure out what since there is no real documentation on how to do this thing (link was dead).

推荐答案

否,则无法链接到WinRT组件.您也许可以使用相同的源代码为电话构建电话,但是共享二进制文件将涉及可移植类库,这是非常严格的.您可能会发现以下帮助:

No, it isn't possible to link to WinRT Components. You may be able to build for the phone using the same source code, but sharing binaries would involve Portable Class Libraries, which is very restrictive. You may find these helpful:

<跨度样式="text-decoration:underline">商店和电话的差异WinRT组件

如何利用您的跨WP8和Windows 8的代码

Co- Windows Phone 7/8和Windows 8指南的开发


这篇关于将WinRT组件链接到我的游戏时出错!的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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