From: "Tobias Gloth" <gloth@uni-muenster.de>
Subject: Bug in cxx (?)
Date: 1997/02/24 [thread overview]
Message-ID: <3311C590.7681@math.uni-muenster.de> (raw)
I try to port a software package that already runs on Linux, Solaris,
IRIX and AIX (everywhere both with the native C++-Compiler and with
g++) to OSF1. When I used g++, I had no trouble. However, I can't
get it to work with cxx. This is what happens:
* When I compile and link and everything normally (no speciel compiler
flags), I get lots of unresolved Symbols (caused by non-instantiated
templates). This happend with static libraries as well as with
shared ones (I hope I built them correlty. I used the no special
compile-flags and "ld -r -o libxxx.so file1.o file2.o ...").
So I had a look at the man-page which told me that the compile-option
-define_templates could help.
* When I used "-define_templates", I get many strange error-messages
like "file.cc:x: error: in this statement, "someMethod" is not a
member of "variable". Looking at the code I thing that the compiler
is wrong. No other compiler ever complained in such a way, so it
looks like a cxx-problem to me. And I get lots of these errors.
The version is (cxx -V) "DEC C++ V1.3B-0 for DEC OSF/1 (Alpha)",
running on (uname -a) "OSF1 xpi413 V3.0 358 alpha".
Here a comes short program that triggers the problem:
----
template<class T>
class Bar;
template<class T>
class Foo {
friend Bar<T>;
int dummy;
};
template<class T>
class Bar {
void func();
Foo<T>* foo;
};
template <class T>
void Bar<T>::func() {
foo->dummy;
}
Foo<int> member;
----
$ cxx -define_templates -c bug.cc
bug.cc:18: error: In this statement, "dummy" is not a member of "foo".
Compilation terminated with errors.
----
If I omit the "-define_templates", everything compiles fine...
Any comments are greatly appreciated,
Thanks, Tobias
--
Tobias Gloth | WWW: http://wwwmath.uni-muenster.de/~gloth
Schmitthausweg 8 | mail: gloth@math.uni-muenster.de
48161 Muenster | phone: 02533-7111
next reply other threads:[~1997-02-24 5:00 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
1997-02-24 5:00 Tobias Gloth [this message]
1997-02-25 5:00 ` Bug in cxx (?) Martin Vorlaender
read-only archive
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox