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: [Mingw-users] dllimport question


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


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