编译C $ C $下.NET [英] Compiling C code for .NET

查看:169
本文介绍了编译C $ C $下.NET的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我如何编译C code在.NET中使用?

How can I compile C code for use in .NET?

目前是用C写的一个游戏;我怎么能转换成净code或将它的某些部分?

There is a game that written in C; how can I convert it to .Net code or use some parts of it?

推荐答案

您可以使用C code直接在.NET。

You can't use C code directly within .NET.

您有几个选项:

  1. 编译C code成一个动态链接库,并使用P /调用,以便从您的.NET程序中调用它。

  1. Compile the C code into a dynamic link library, and use P/Invoke in order to call it from your .NET program.

港C code到.NET。

Port the C code to .NET.

总结使用C ++ / CLI(制作混合模式组件)的C code,并使用这些从内部选择你的其他.NET语言。

Wrap the C code using C++/CLI (making a mixed mode assembly), and use these from within your other .NET language of choice.

这篇关于编译C $ C $下.NET的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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