CP_EXPORT in class declaration in C ++

What does it mean when a class is declared like this:

class CP_EXPORT CP_Window : public CP_Window_Imp

      

What does CP_EXPORT

part / implies?

+2


a source to share


3 answers


CP_EXPORT

most likely a macro for conditionally exporting or importing a class from a DLL.



For example, when using Visual C ++, the macro is used to conditionally choose between using dllexport

anddllimport

. This allows the same header to be used both for building the project of the DLL itself and for any projects that link or load the DLL.

+3


a source


Are you using C-Pluff ?

Defines:



#define     CP_EXPORT
    Declares a symbol to be exported for inter-module usage. 
#define     CP_IMPORT
    Declares a symbol to be imported from another module. 
#define     CP_HIDDEN
    Declares a symbol hidden from other modules. 

      

+2


a source


CP_EXPORT

is a macro that expands to some special compiler-related construct (maybe __declspec

in MSVC or __attribute__

gcc) that does something. To find out what exactly you need to find the definition of the macroCP_EXPORT

+1


a source







All Articles