Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Should enums be exported out of dll or not?

The project (in cpp) we are working on exports enum types from the dll. In exporting we are having some issues so I wanted to ask something related to exporting enum type.

I think that enum's behave like 'kind of' constants, so they do not provide any 'functionality' to the user. So, can we omit the exporting of enum's ?

OR

Are there some functionalities (other than behaving as constants) that the enum's provide to the end-user that makes it necessary to export them ?

More details :

We have a header file containing following piece of code:

enum DECL_BASE logical_state
{
    LOGICAL_TRUE,
    LOGICAL_FALSE,
    LOGICAL_DEFAULT
};

//DECL_BASE is __declspec(dllexport)

This code compiles fine with no warnings or errors. I just wanted to know that what is/are the use(s) of exporting this.

Thanks

like image 717
Ayush Avatar asked Nov 03 '16 11:11

Ayush


1 Answers

Usually for using the enums and constants of a dll, for calling the exported interfaces of the dll, we only have to declare those enums and constants in the provided dll's header file(s). No export calling convention is needed for them.

Please give more clarity to your issue, if the above comment doesn't solve your problem.

like image 175
aks Avatar answered Nov 13 '22 12:11

aks