You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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).
The text was updated successfully, but these errors were encountered:
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 defineEXPORT_API
like thisEXPORT_API __declspec(dllimport)
and not like thisEXPORT_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).The text was updated successfully, but these errors were encountered: