Skip to content
This repository was archived by the owner on Sep 28, 2025. It is now read-only.
This repository was archived by the owner on Sep 28, 2025. It is now read-only.

Can't link when used by a C++ project #15

@jaryder

Description

@jaryder

Hi there, I was giving your API hook library a try and could not get linking to work (my project is using C++). After quite a bit of digging I found that the problem was C++ name mangling of the function declarations in funchook.h.

You can fix this by adding the following to explicitly use C-linkage conventions:

#ifdef __cplusplus
extern "C" {
#endif

... Your function declarations here ...

#ifdef __cplusplus
} // extern "C"
#endif

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