C++ to C Wrapper using SWIG (for FLTK)

2019-02-16 14:10发布

问题:

I need to generate wrapper to FLTK C++ classes to use it in pure C. I know, that SWIG can do that, and I know how to generate wrapper for C#, Python etc. But I do not know how to wrap C++ to C using SWIG. It's simple task, but I can't find the answer :) Please, help.

回答1:

I don't think SWIG supports generation of C wrappers out of the box. You always need to specify a target language. In 2008, there was a GSoC project to write a C backend, but that was apparently never completed/incorporated into SWIG.