为Windows Phone 8编译本机代码(c ++)

时间:2014-04-14 01:47:26

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

我创建了一个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)

如果有人有任何想法,请帮助

1 个答案:

答案 0 :(得分:0)

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

http://cocos2d-x.org/download

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