3

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!

Community
  • 1
  • 1
ZaneArn
  • 73
  • 7

1 Answers1

5

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.

Matthias
  • 15,919
  • 5
  • 39
  • 84
  • I'd like to add that if you go into the vcproj file created in your answer you can actually edit it to contain a single file wildcard such as "*.cs" so that it will continue to work as new files are added to the C# bindings. We use this method in a project I'm currently working on. It takes a few minutes to tweak it to your needs, but it helps with automated builds. – lefticus Dec 24 '11 at 06:31
  • Thanks for the answer! I put all generated classes under **namespace MyProjectName** I 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. It's 22:36pm here in Australia so MERRY CHRISTMAS guys! – ZaneArn Dec 24 '11 at 11:32