2008/5/26 William S Fulton <wsf@fultondesigns.co.uk>:
Kazovsky Ilya wrote:
Hello world!

I'm using SWIG to wrap some C library to C#. I have two modules and two classes for this modules (i don't use automatically generated wrappers) . One works properly, but another one does not.

here is an examples:

module1.i:
%module1
%{
#include "../wrappers/module1.h"
%}

extern void* Foo();
....
this one works perfect.

module2.i
%module2.i
%{
#include "../wrappers/module2.h"
%}

extern void* Bar(void*, void*);

it wraps by C function:
SWIGEXPORT void * SWIGSTDCALL CSharp_Bar(void*, void*) {...}

and by C# function:
class module2
{
[DllImport("library", EntryPoint="CSharp_Bar")]
public static extern IntPtr Bar(HandleRef, HandleRef);
}
but when i run program i got this:
Unhandled Exception: System.EntryPointNotFoundException: CSharp_Bar
 at (wrapper managed-to-native) wrappers.module2PINVOKE:Bar(System.Runtime.InteropServices.HandleRef,System.Runtime.InteropServices.HandleRef)


You probably havn't compiled the generated wrapper into library.dll. Check using tools like dumpbin or depends.

William

I'm using Mono to build the project. All generated files are included as external link. Here should be no mistake.


--
Yours faithfully, gIlya.