Getting SWIG to work with C++/Python

Jason Maskell backov at nospam.csolve.net
Fri Jan 7 13:12:53 EST 2000


Brian Dam Pedersen <brian.pedersen at mail.danbbs.dk> wrote in message
news:yPmd4.37$ed.1161540647 at news.euroconnect.net...
> SWIG is very picky with its C++ syntax. For example it chokes on the
> following code from VC++
>
> class NOFFER_API CNoffer {
> public:
>  CNoffer(void);
>  // TODO: add your methods here.
> };
>
> The NOFFER_API part bothers it. You have to make a .i file containing a
> cleaned-up version of your classes or functions. This will also give you
the

Yep, on more careful analysis of the error messages, I noticed that the
lines it were choking on were the function declarations, which often have
stuff like __fastcall, which is just a BCB way to tell the compiler what
calling conventions to use. I guess it's going to be a lot more work than I
thought to use swig. ;>

Cheers,
Jason






More information about the Python-list mailing list