From mboxrd@z Thu Jan 1 00:00:00 1970 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 1164f8,e239b42d4a8451b1,start X-Google-Attributes: gid1164f8,public From: "Tobias Gloth" Subject: Bug in cxx (?) Date: 1997/02/24 Message-ID: <3311C590.7681@math.uni-muenster.de>#1/1 X-Deja-AN: 221103415 Sender: "Tobias Gloth" Content-Type: text/plain; charset=us-ascii Organization: Westfaelische-Wilhelms-Universitaet Muenster Mime-Version: 1.0 Newsgroups: comp.sys.dec X-Mailer: Mozilla 3.0 (X11; I; SunOS 5.5.1 sun4u) 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 Bar; template class Foo { friend Bar; int dummy; }; template class Bar { void func(); Foo* foo; }; template void Bar::func() { foo->dummy; } Foo 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