如何编译SWIG生成的C#文件到.NET的DLL? [英] How to compile SWIG generated C# files into a .NET DLL?

查看:258
本文介绍了如何编译SWIG生成的C#文件到.NET的DLL?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在<一个href="http://stackoverflow.com/questions/25268/what-are-the-best-practices-when-using-swig-with-c/1070469#1070469">this螺纹,马克·伯尼尔提到痛饮也产生了一堆,我编译成一个.NET的DLL C#中的文件。

我生成的C#文件,我的课了。但我真的想不出如何构建成.NET的DLL。我完全入门到.Net和DLL。

看来我'@'是不是在这里工作。 @MarcBernier。或任何人知道我该怎么联系马克?

-------编辑---------

感谢您的回答!我把所有生成的类在命名空间MyProjectName

编译它,似乎它的工作,我把生成的C#DLL到单声道和编辑器可以自动完成的 MyprojectName.ClassName.Method()

但是编译器也抱怨: EntryPointNotFoundException:SWIGRegisterExceptionCallbacks_MaxFlowGraph

(在此之前,它抱怨DLL没有找到,所以我把原来的C ++ DLL,它停止了)

我使用的是单声道的Win7下32位,并且不知道发生了什么 - 我是一个菜鸟,我需要帮助,帮助

这是22点36分在澳大利亚这样的圣诞快乐的家伙!

解决方案

创建类型的类库中的Visual Studio 新项目。然后右键单击该项目,选择的添加>现有项目的..然后选择由痛饮产生的所有生成的 *。CS 文件。 <大骨节病> SHIFT + CTRL + B 和它编译。<​​/ P>

In this thread, Marc Bernier mentioned "SWIG also generated a bunch of C# files which I compiled into a .NET DLL".

I generated the C# files for my class too. But I really can not figure out how to build that into a .Net Dll. I'm totally noob to .Net and DLL.

Seems I '@' is not working here. @MarcBernier. Or anyone knows how can I contact Marc?

-------edit---------

Thanks for the answer! I put all generated classes under namespace MyProjectName

compiled it and seems it worked, I put the generated C#DLL into Mono and the editor can auto complete MyprojectName.ClassName.Method().

But the compiler also complained: EntryPointNotFoundException: SWIGRegisterExceptionCallbacks_MaxFlowGraph

(Before that it complained DLL not found, so I put in the original C++ dll and it stopped)

I'm using Mono under Win7 32bit, and no idea what's happening -- I'm a noob, I need help, help.

It's 22:36pm here in Australia so MERRY CHRISTMAS guys!

解决方案

Create a new project in Visual Studio of type Class Library. Then right-click the project and select Add > Existing items.. Then select all generated *.cs files generated by SWIG. Shift+Ctrl+B and it compiles.

这篇关于如何编译SWIG生成的C#文件到.NET的DLL?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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