This is the mail archive of the
gcc-help@gcc.gnu.org
mailing list for the GCC project.
Re: [Mingw-users] dllimport question
- From: Danny Smith <dannysmith at clear dot net dot nz>
- To: Paul Kienzle <pkienzle at jazz dot ncnr dot nist dot gov>, gcc-help at gcc dot gnu dot org
- Date: Wed, 29 Jan 2003 01:31:24 +0000
- Subject: Re: [Mingw-users] dllimport question
- References: <20030128123641.H6924007@jazz.ncnr.nist.gov>
- Reply-to: Danny Smith <dannysmith at users dot sourceforge dot net>
----- Original Message -----
From: "Paul Kienzle" <pkienzle@jazz.ncnr.nist.gov>
To: <gcc-help@gcc.gnu.org>
Sent: Tuesday, 28 January 2003 17:36
Subject: [Mingw-users] dllimport question
> Hi!
>
> I'm using g++ under windows to create some separately
> loadable modules for GNU Octave. As it stands, libstdc++
> is linked statically and each module huge. To reduce the
> dll size, I've been trying to create a dll version of
> libstdc++.
>
> Using dlltool, this isn't too hard, though I do have to
> use the following in my source:
> #include <iostream>
> namespace std {
> __declspec(dllimport) ostream cout;
> } ;
Change this to
extern __declspec(dllimport) ostream cout;
^^^^^^
cout is an object.
With more recent GCC , the extern is supplied implicitly when dllimport
is used in declaration. With 3.2.0 it is not.
Danny