C ++到字节码编译器的Silverlight CLR? [英] C++ to bytecode compiler for Silverlight CLR?

查看:196
本文介绍了C ++到字节码编译器的Silverlight CLR?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我希望能够编译一个C / C ++库,以便在Silverlight CLR的安全托管运行时中运行。

I'd like to be able to compile a C/C++ library so that it runs within a safe managed runtime in the Silverlight CLR.

几个工具用于使用JVM允许C ++代码在CRT仿真层中运行(参见 NestedVM LLJVM 等),这有效地允许C ++代码在Java Applet中运行。甚至还有一个用于Adobe Flash VM的工具(请参见 Alchemy )。

There are several tools for doing this with the JVM that allows C++ code to run within a CRT emulation layer (see NestedVM, LLJVM, etc), which effectively allows C++ code to be run within a Java Applet. There's even a tool for this for the Adobe Flash VM (see Alchemy).

然而,我似乎找不到任何工具像这样的CLR。 fyi,MSVC工具似乎不允许这样: / clr:pure 标志将创建在CLR中运行的C ++代码,但它不安全因为CRT不安全)和 / clr:safe 需要大量的代码更改(无原生类型等)。

However, I can't seem to find any tools like this for the CLR. fyi, the MSVC tools don't seem to allow for this: The /clr:pure flag will create C++ code that runs in the CLR, but it isn't safe (because the CRT isn't safe) and /clr:safe requires massive code changes (no native types, etc).

推荐答案

然后我觉得你很幸运。如果你的代码不能使用/ clr:safe标志,那么它不会被编译成可以在Silverlight中运行的东西。如果C ++正在做一些CLR不允许或不支持的事情,那么就没有直接的办法了。

Then I think you are plain out of luck. If your code can't use the /clr:safe flag then it won't be compilable into something that can run in Silverlight. If the C++ is doing something that the CLR does not allow or support, then there is no way around this directly.

根据代码的作用,你可以执行它在服务器上并通过Web服务从Silverlight调用它?

Depending what your code does, you could possibly execute it on the server and call that from Silverlight via a web service?

这篇关于C ++到字节码编译器的Silverlight CLR?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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