Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can't #include mimick.c from a C++ source #14

Open
jiridanek opened this issue Sep 22, 2020 · 2 comments
Open

Can't #include mimick.c from a C++ source #14

jiridanek opened this issue Sep 22, 2020 · 2 comments

Comments

@jiridanek
Copy link

When I try, I get compile errors of the type

mimick.h:36:26: error: conflicting declaration ‘typedef struct mmk_stub* mmk_stub’

In C++ the type names have to be disambiguated, such as mmk_stub_t, and so on.

@jiridanek
Copy link
Author

Having overcome the reported issue, it looks like that is the least of my worries. Probably best to use mimick only in C code.

@Snaipe
Copy link
Owner

Snaipe commented Sep 22, 2020

Feel free to cherry pick commits from #13 -- I don't know if these 100% work, but I expect they'd at least let you compile.

I don't see any reason why mimick wouldn't work with C++ functions. Are you making sure the functions you're trying to mock are 1) not class methods and 2) that you're using mangled names when installing the mock (or marking the functions themselves extern "C"?)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants