DEV Community

Zheng Yun
Zheng Yun

Posted on

How can I derive a base class in go? The base class is written in C++ and I export it with swig

A base Class written in C++ as below.

// BaseCase.h
class BaseCase
{
public
    BaseCase() {}
    virtual ~BaseCase() {}
    BaseCase(const BaseCase& rhs) {
        m_caseName = rhs.m_caseName;
    }

public:
    string m_caseName;
};

I use swig to export this baseclass with swig.i:

// swig.i
%module(directors="1") baseCase
%{
 #include "BaseCase.h"
%}
%include "std_string.i"

Top comments (0)