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

Export functions through DLL for other libraries to use #182

Open
LordMike opened this issue Feb 2, 2022 · 2 comments
Open

Export functions through DLL for other libraries to use #182

LordMike opened this issue Feb 2, 2022 · 2 comments
Assignees

Comments

@LordMike
Copy link

LordMike commented Feb 2, 2022

I'm not entirely sure how this is meant to work, but if I want to interop with the API from C#, I had to do the following:

  • Compile as a dll (please provide binaries :))
  • Add __declspec(dllexport) to functions, to ensure they're exported

Could these things be done in the project itself, so that I and others can interop with the produced binary?

@Oxymoron79 Oxymoron79 mentioned this issue Feb 4, 2022
4 tasks
@Oxymoron79
Copy link
Collaborator

Yes, that can be done in the project, but in a portable way. This is often achieved with a pre-processor macro like this one: https://github.com/zeromq/libzmq/blob/master/include/zmq.h#L62

@LordMike
Copy link
Author

LordMike commented Feb 4, 2022

Yes, exactly. I had a hard time adding these locally, as there are so many methods, and I couldn't quickly identify which ones should be exported. It would have been easier if all public methods had been defined using a macro, so I could modify that and thereby add the export declaration.

A macro could be helpful also to ensure a consistent API surface, such as the oc_ prefix.

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

3 participants