【问题标题】:Compiling Native code (c++) for windows phone 8为 windows phone 8 编译本机代码 (c++)
【发布时间】:2014-04-14 01:47:25
【问题描述】:

我创建了一个 cocos2d-x 3.0 RC 项目,我也想在 Windows 中玩。我已将 CocosDension、libExtensions、libNetwork、libCurl 等库添加到我的项目中,因为这些是游戏所需的。编译时一切正常,但是当我尝试运行时,出现以下运行时错误。下面提到的是抛出的异常。

“System.IO.FileNotFoundException”类型的异常发生在 PhoneDirect3DXamlAppInterop.DLL 但未在用户代码中处理。如果 有这个异常的处理程序,程序可能是安全的 继续。

在下面的代码块中抛出了这个特殊的异常

private void DrawingSurfaceBackground_Loaded(object sender, RoutedEventArgs e)
        {
            if (m_d3dInterop == null)
            {
                m_d3dInterop = new Direct3DInterop();

                // Set WindowBounds to size of DrawingSurface
                m_d3dInterop.WindowBounds = new Windows.Foundation.Size(
                    (float)Application.Current.Host.Content.ActualWidth,
                    (float)Application.Current.Host.Content.ActualHeight
                    );

                // Hook-up native component to DrawingSurfaceBackgroundGrid
                DrawingSurfaceBackground.SetBackgroundContentProvider(m_d3dInterop.CreateContentProvider());
                DrawingSurfaceBackground.SetBackgroundManipulationHandler(m_d3dInterop);

                // Hook-up Cocos2d-x delegates
                m_d3dInterop.SetCocos2dEventDelegate(OnCocos2dEvent);
                m_d3dInterop.SetCocos2dMessageBoxDelegate(OnCocos2dMessageBoxEvent);`
                m_d3dInterop.SetCocos2dEditBoxDelegate(OpenEditBox);
            }
        }

在行抛出异常

m_d3dInterop = new Direct3DInterop();

我还将错误日志放在下面

The specified module could not be found. (Exception from HRESULT: 0x8007007E)

   at System.StubHelpers.StubHelpers.GetWinRTFactoryObject(IntPtr pCPCMD)
   at PhoneDirect3DXamlAppComponent.Direct3DInterop..ctor()
   at PhoneDirect3DXamlAppInterop.MainPage.DrawingSurfaceBackground_Loaded(Object sender, RoutedEventArgs e)
   at MS.Internal.CoreInvokeHandler.InvokeEventHandler(Int32 typeIndex, Delegate handlerDelegate, Object sender, Object args)
   at MS.Internal.JoltHelper.FireEvent(IntPtr unmanagedObj, IntPtr unmanagedObjArgs, Int32 argsTypeIndex, Int32 actualArgsTypeIndex, String eventName)

如果有人有相同的想法,请帮忙

【问题讨论】:

    标签: c++ windows-phone-8 cocos2d-x cocos2d-x-3.0


    【解决方案1】:

    我会更新新发布的 Cocos2d-x v3,因为它支持 WP8。

    http://cocos2d-x.org/download

    发行说明:https://github.com/cocos2d/cocos2d-x/blob/v3/docs/RELEASE_NOTES.md

    【讨论】:

      猜你喜欢
      • 2013-05-07
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2012-12-28
      • 2013-11-06
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多