Hi at all,

 

i have a big problem.

I use visual studio.net 2003, xp-prof, swigwin-1.3.25 and active python. I can compile my project “dll_project” without problems, but when I try to import the _dll_project into python I get following error:

 

Traceback (most recent call last):

  File "<stdin>", line 1, in ?

ImportError: dynamic module does not define init function (init_dll_project)

 

I have no clue what I have to do. In my “dll_project_wrap.c” file there is a “init_dll_project” function, see below

 

#define SWIG_init    init_dll_project

#define SWIG_name    "_dll_project"

 

Is it possible, that the “dll_project_wrap.c” is not correct implementet in my .net project? What’s wrong?

In the attachment you can find some settings that I made in my project!

 

Please help, I need this for my thesis!

Thanks in advance and sorry for my bad English, but I’m not a native English speaker!

 

Greetings alex

Some .net settings:
Multithreaded-Debug-DLL (/MDd)  – Codegeneration
$(OutDir)/_dll_project.dll                      - Linker/OIutputfile

Some *.i file settings
swig -python -o $(ProjectDir)$(InputName)_wrap.c $(InputPath)   - Commandline 
input
$(ProjectDir)$(InputName)_wrap.c                                - Commandline 
output


Here is my dll_project.i and my dll_project.c file:

Interface-File
/* File : dll_project.i */
%module dll_project
%{
/* Put headers and other declarations here */
%}

extern double My_variable;
extern int    fact(int);
extern int    my_mod(int n, int m);


C-CODE
/* File : dll_project.c */

double  My_variable  = 3.0;

/* Compute factorial of n */
int  fact(int n) {
        if (n <= 1) return 1;
        else return n*fact(n-1);
}

/* Compute n mod m */
int my_mod(int n, int m) {
        return(n % m);
}

Attachment: smime.p7s
Description: S/MIME cryptographic signature

_______________________________________________
ActivePython mailing list
ActivePython@listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
Other options: http://listserv.ActiveState.com/mailman/listinfo/ActivePython

Reply via email to