C++ to bytecode compiler for CLR?

孤者浪人 提交于 2019-12-08 08:13:17

问题


I'd like to be able to compile a C/C++ library so that it runs within a managed runtime in the CLR. There are several tools for doing this with the JVM (NestedVM, LLJVM, etc) but I can't seem to find any for the CLR. Has anyone tried doing this?


回答1:


Microsoft already provides such a tool with Visual Studio. The C++ compiler cl.exe accepts the /clr option to tell it to generate managed code instead of native code. See the MSDN document How To: Migrate to /clr for information on changing your native project to support managed code.




回答2:


If you have the source code and it compiles under Visual C++ compiler, then from 2005 onwards you can switch the /clr flag and it should compile it to IL rather than a native binary.



来源:https://stackoverflow.com/questions/2760167/c-to-bytecode-compiler-for-clr

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!