This is the mail archive of the gcc-help@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Declaring functions/classes export from shared libraries...


Michael Burbidge <mburbidg@adobe.com> writes:

> VC++ supports the following the attribute __declspec(dllexport) to
> specify that a function or class should be exported from a shared
> library as in the following examples:
> 
> __declspec(dllexport) bool HaveLockedItems();
> 
> or for a class:
> 
> class __declspec(dllexport) Rect
> {
> ...
> };
> 
> How does one control exports using gcc?

See dllexport and dllimport here:
    http://gcc.gnu.org/onlinedocs/gcc-3.3.1/gcc/Function-Attributes.html#Function%20Attributes

Note in particular:

    On cygwin, mingw and arm-pe targets, __declspec(dllexport) is
    recognized as a synonym for __attribute__ ((dllexport)) for
    compatibility with other Windows compilers.

Ian


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]