DLL export of a static function

一曲冷凌霜 提交于 2019-12-01 09:11:11

You may not export that function from a DLL. static functions are equivalent to private to that file.

You can create a method in the file that calls it and export that.

By defining a function with static and inline you are effectively guaranteeing that it will be only in the modules that includes the definition.

Either edit each file to remove the static inline (which might break) or change everything to use a PreProcessor directive that will allow you to have either:

#define MYAPI static inline

or

#define MYAPI __declspec(dllexport)

and then

MYAPI HandVal StdDeck_StdRules_EVAL_N( StdDeck_CardMask cards, int n_cards )

or build a set of wrappers as a seperate module which does

__declspec(dllexport) HandVal Public_StdDeck_StdRules_EVAL_N( StdDeck_CardMask cards, int n_cards )
{
     return StdDeck_StdRules_EVAL_N(cards, n_cards);
}
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!