delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/1999/11/11/23:51:29

Mailing-List: contact cygwin-help AT sourceware DOT cygnus DOT com; run by ezmlm
List-Unsubscribe: <mailto:cygwin-unsubscribe-archive-cygwin=delorie DOT com AT sourceware DOT cygnus DOT com>
List-Subscribe: <mailto:cygwin-subscribe AT sourceware DOT cygnus DOT com>
List-Archive: <http://sourceware.cygnus.com/ml/cygwin/>
List-Post: <mailto:cygwin AT sourceware DOT cygnus DOT com>
List-Help: <mailto:cygwin-help AT sourceware DOT cygnus DOT com>, <http://sourceware.cygnus.com/ml/#faqs>
Sender: cygwin-owner AT sourceware DOT cygnus DOT com
Delivered-To: mailing list cygwin AT sourceware DOT cygnus DOT com
Message-ID: <000701bf2cca$48c5c600$7b0681d4@ziggy>
From: "vincent penne" <vincent DOT penne AT freesbee DOT fr>
To: <cygwin AT sourceware DOT cygnus DOT com>
Subject: Building C++ library DLL
Date: Fri, 12 Nov 1999 05:56:29 +0100
MIME-Version: 1.0
X-Priority: 3
X-MSMail-Priority: Normal
X-Mailer: Microsoft Outlook Express 4.72.3110.5
X-MimeOLE: Produced By Microsoft MimeOLE V4.72.3110.3

------=_NextPart_000_0004_01BF2CD2.A9E3DBE0
Content-Type: text/plain;
	charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable

Hi all,
maybe it's not the correct list where to ask for since my problem is GCC =
related, but I try anyway.

With Microst Visual C++ it is possible to write something like

class __declspec(dllexport) foo {
    static int foo_var;

    void foo_function();
}

This will export the function and the static variable without need to =
put the __declspec(dllexport) on every line of the class definition.

When using the library, one can write

class __declspec(dllimport) foo {
 ...

My question : Is it supposed to work with GCC too ? If not, are there =
any plans to implement such a nice feature ? This make porting of C++ =
library to windows a lot more easy, since there is a lot less __declspec =
directive to put in the header files ...


------=_NextPart_000_0004_01BF2CD2.A9E3DBE0
Content-Type: text/html;
	charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable

<!DOCTYPE HTML PUBLIC "-//W3C//DTD W3 HTML//EN">
<HTML>
<HEAD>

<META content=3Dtext/html;charset=3Diso-8859-1 =
http-equiv=3DContent-Type>
<META content=3D'"MSHTML 4.72.3110.7"' name=3DGENERATOR>
</HEAD>
<BODY bgColor=3D#ffffff>
<DIV><FONT color=3D#000000 size=3D2>Hi all,</FONT></DIV>
<DIV><FONT color=3D#000000 size=3D2>maybe it's not the correct list =
where to ask for=20
since my problem is GCC related, but I try anyway.</FONT></DIV>
<DIV><FONT color=3D#000000 size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT color=3D#000000 size=3D2>With Microst Visual C++ it is =
possible to write=20
something like</FONT></DIV>
<DIV><FONT color=3D#000000 size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT color=3D#000000 size=3D2>class __declspec(dllexport) foo =
{</FONT></DIV>
<DIV><FONT color=3D#000000 size=3D2>&nbsp;&nbsp;&nbsp; static int=20
foo_var;</FONT></DIV>
<DIV><FONT color=3D#000000 size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT color=3D#000000 size=3D2>&nbsp;&nbsp;&nbsp; void=20
foo_function();</FONT></DIV>
<DIV><FONT color=3D#000000 size=3D2>}</FONT></DIV>
<DIV><FONT color=3D#000000 size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT color=3D#000000 size=3D2>This will export the function and =
the static=20
variable without need to put the __declspec(dllexport) on every line of =
the=20
class definition.</FONT></DIV>
<DIV><FONT color=3D#000000 size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT color=3D#000000 size=3D2>When using the library, one can=20
write</FONT></DIV>
<DIV><FONT color=3D#000000 size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT color=3D#000000 size=3D2>
<DIV><FONT color=3D#000000 size=3D2>class __declspec(dllimport) foo =
{</FONT></DIV>
<DIV><FONT color=3D#000000 size=3D2>&nbsp;...</FONT></DIV>
<DIV><FONT color=3D#000000 size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT color=3D#000000 size=3D2>My question : Is it supposed to work =
with GCC=20
too ? If not, are there any plans to implement such a nice feature ? =
This make=20
porting of C++ library to windows a lot more easy, since there is a lot =
less=20
__declspec directive to put in the header files ...</FONT></DIV>
<DIV><FONT color=3D#000000 =
size=3D2></FONT>&nbsp;</DIV></FONT></DIV></BODY></HTML>

------=_NextPart_000_0004_01BF2CD2.A9E3DBE0--

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019