I'm using swig to produce a python C++ interface such that I can make scripts in python to call my c++ functions. I've gotten as far as:
swig -c++ python filename.i
gcc -c filename.cpp filename_wrap.cxx -shared -Ic:\includepath
Where the include path is my python27's include directory.
Upon attempting to compile with gcc, I get a whole slew of errors stating that many of my functions were declared as extern and now static. In the original cpp file, I had declared some of my functions as static. I have never declared anything as extern. What could this be caused by?
This is my interface file
/* Interface */
%module ReadWrite
%{
#include "ReadWrite.h"
%}
%include "ReadWrite.h"
A snippet of header file (names changed) looks like this (nothing is declared as extern)
static bool myfunc1(void);
static bool myfunc2 (type1 *Entry, type2 *Block, type2 *Data);
static bool myfunc3 (type2 *Data, type3 **Records, type2 **Header);
type4 myfunc4 (void) ;
When I do a gcc -c ReadWrite.cpp ReadWrite_wrap.cxx -shared -Ic:\includepath, I'll get errors like from gcc:
ReadWrite.cpp:682:79: error: 'bool myfunc3 (type2 *Data, type3 **Records, type2 **Header)' was declared 'extern' and later 'static'