SWIG

P

Philip Smith

Does anyone use SWIG?????

I'm having trouble patching it to allow me to compile wrappers in Borland
C++ Builder because Borland will insist on adding underscores to symbols.
Turn this off and it won't link the Python library.

The answer is to declare init_function and any other exported functions as
__stdcall. Easy enough to patch the SWIG file for the init_function but I
can't for the life of me see how to automate this process for other exports.
Any ideas??

Phil
 
R

Roger Binns

Philip Smith said:
Does anyone use SWIG?????

Yes, thousands.
I'm having trouble patching it to allow me to compile wrappers in Borland C++ Builder because Borland will insist on adding
underscores to symbols.

You need to ensure that the calling convention in the headers seen by
the compiler are consistent. (It is unclear from your description where
the mismatch is happening - in the wrapper functions generated by Swig
or the calls to your existing code that is being wrapped)

Swig does handle Borland C for marking the wrapping functions for dll export.

I actually use MinGW and everything works perfectly for C and C++ code,
even for C code where the dll was compiled with MSVC and I don't have
the source.

(I also use Swig on Linux and Mac but that is incidental).

Roger
 

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
474,212
Messages
2,571,101
Members
47,695
Latest member
KayleneBee

Latest Threads

Top