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

Missing __declspec(dllimport) #3

Open
jcxz opened this issue Apr 15, 2019 · 0 comments
Open

Missing __declspec(dllimport) #3

jcxz opened this issue Apr 15, 2019 · 0 comments

Comments

@jcxz
Copy link

jcxz commented Apr 15, 2019

Hi,

header files from your SDK are missing __declspec(dllimport). Without it, the DLL does not work. For example global variables exported by the SDK are not properly initialized and can cause linking errors (when linking with the provided .lib file). You should define EXPORT_API like this EXPORT_API __declspec(dllimport) and not like this EXPORT_API __declspec(dllexport).

And in my opinion, you should use a different name for that macro. Something like HOLOPLAY_API would certainly do a better job, EXPORT_API is just too generic and could cause name clashes in the code of your clients.

And you should also consider adding extern keyword in front of all exported global variables. It is not strictly necessary when __declspec(dllimport) is used, but it is a good common practice. extern "C" block itself does not turn your global variable definitions into declarations (see https://stackoverflow.com/questions/21026264/extern-declaration-on-an-extern-c-global-variable).

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

1 participant