[Mingw-users] dllimport question

Danny Smith dannysmith@clear.net.nz
Wed Jan 29 01:35:00 GMT 2003


----- 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



More information about the Gcc-help mailing list