help python swig problem

A

ajikoe

Hi,

I tried to follow the example in swig homepage.
I found error which I don't understand.
I use bcc32, I already include directory where my python.h exist in
bcc32.cfg.

/* File : example.c */

#include <time.h>
double My_variable = 3.0;

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

int my_mod(int x, int y) {
return (x%y);
}

char *get_time()
{
time_t ltime;
time(&ltime);
return ctime(&ltime);
}

-------------------------
/* example.i */
%module example
%{
/* Put header files here or function declarations like below */
extern double My_variable;
extern int fact(int n);
extern int my_mod(int x, int y);
extern char *get_time();
%}

extern double My_variable;
extern int fact(int n);
extern int my_mod(int x, int y);
extern char *get_time();

------------------------------------------------------------
I write this in my dos console:
swig -python example.i # this is ok
bcc32 -c example.c example_wrap.c # this has error
I found this error:
Borland C++ 5.5.1 for Win32 Copyright (c) 1993, 2000 Borland
example.c:
example_wrap.c:
Warning W8004 example_wrap.c 428: 'uu' is assigned a value that is
never used in function SWIG_UnpackData
Warning W8004 example_wrap.c 669: 'flags' is assigned a value that is
never used in function PySwigObject_print
Error E2063 example_wrap.c 791: Illegal initialization in function
PySwigObject_type
Warning W8057 example_wrap.c 1660: Parameter 'self' is never used in
function _wrap_fact
Warning W8057 example_wrap.c 1688: Parameter 'self' is never used in
function _wrap_my_mod
Warning W8065 example_wrap.c 1696: Call to function 'get_time' with no
prototype in function _wrap_get_time
Warning W8057 example_wrap.c 1702: Parameter 'self' is never used in
function _wrap_get_time
Warning W8060 example_wrap.c 2106: Possibly incorrect assignment in
function SWIG_Python_FixMethods
*** 1 errors in Compile ***

How can I solve the problem.

Thanks in advance.

pujo
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,582
Members
45,062
Latest member
OrderKetozenseACV

Latest Threads

Top