This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
g++ bug in dllexport (on windows)
- To: gcc at gcc dot gnu dot org
- Subject: g++ bug in dllexport (on windows)
- From: Marat Boshernitsan <maratb at CS dot Berkeley dot EDU>
- Date: 24 Apr 2000 02:27:37 -0700
- Cc: abegel at cs dot Berkeley dot EDU
The following snippet of code causes an "interesting" error message on
win32:
---- cut ----
#define DLLIMPORT __attribute__(( dllexport ))
class DLLIMPORT NODE {
class DLLIMPORT Property {
friend class NODE;
};
};
class DLLIMPORT UltraRoot : public NODE {
public:
void UltraRoot::tree_size (const NODE *node = __null) const {
const NODE *tmp = node ? node : this;
}
};
---- cut ----
compiling with "g++ -c -o bug.o bug.cc" yields:
bug.cc:12: type `const NODE' is not a base type for type `const NODE'
bug.cc:12: type `const NODE' is not a base type for type `const UltraRoot'
Doesn't make much sense, does it?
Undefining DLLIMPORT fixes the error.
Removing "friend class NODE" fixes the error.
The compiler is "gcc version 2.95.2 19991024 (release)" on
"CYGWIN_NT-4.0 DOGWOOD 1.1.0(0.17/3/2) 2000-03-01 00:15:19 i686 unknown"
(For obvious reasons, I can't test this on Unix).
Any thoughts? Workarounds?
Thanks in advance!
Marat Boshernitsan.