DLL export of a static function

后端 未结 2 1044
说谎
说谎 2021-01-14 08:41

I have the following static function:

static inline HandVal
              StdDeck_StdRules_EVAL_N( StdDeck_CardMask cards, int n_cards )

Ca

2条回答
  •  北海茫月
    2021-01-14 09:22

    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);
    }
    

提交回复
热议问题