Skip to content

Not callable from C++ without wrappers #10

@titinko

Description

@titinko

I tried to use this library from C++ and ended up needing to add an extern "C" wrapper around the method headers in pyin.h to make it callable by C++. These wrappers could be built into pyin.h to make things easier on the next C++ coder who uses this library:

#ifdef __cplusplus
extern "C" {
#endif

// The method headers that need to be wrapped.
pyin_config pyin_init(int nhop);
int pyin_trange(int nq, FP_TYPE fmin, FP_TYPE fmax);
FP_TYPE* pyin_analyze(pyin_config param, FP_TYPE* x, int nx, FP_TYPE fs, int* nfrm);

#ifdef __cplusplus
}
#endif

See https://stackoverflow.com/questions/1041866/what-is-the-effect-of-extern-c-in-c for more context on this issue.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions