This is the mail archive of the
gcc-help@gcc.gnu.org
mailing list for the GCC project.
Re: Declaring functions/classes export from shared libraries...
- From: Ian Lance Taylor <ian at wasabisystems dot com>
- To: Michael Burbidge <mburbidg at adobe dot com>
- Cc: gcc-help at gcc dot gnu dot org
- Date: 03 Oct 2003 06:57:02 -0700
- Subject: Re: Declaring functions/classes export from shared libraries...
- References: <E21B3E59-F5A8-11D7-AA82-000393D55D34@adobe.com>
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