Hi,
I am using SWIG to generate the wrapper for python i.e. I am tring to correlate the c++ and python2.4. I am using the windowsXP platform with Visual Studio 2005 Editor and the Turbo c++ complier.
The problem is that after Generating the c++ file and the python file I am unable to compile the c++ file generated by SWIG.
Here is my sample c++ file :-
#include<stdio.h>
#include<time.h>
double My_var = 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(<ime);
return ctime(<ime);
}
void main()
{
printf("\nFactorial of 5 = %d ",fact(5));
printf("\nRemainder of 5/2 = %d",my_mod(5,2));
printf("\nCurrent time = %s",get_time());
}
And its related Interface file:-
/* exx.i */
%module exx
%{
/* Put header files here or function declarations like below */
extern double My_var;
extern int fact(int n);
extern int my_mod(int x,int y);
extern char *get_time();
%}
%include exx.cpp
please help me.