Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!mnetor!uunet!nbires!hao!oddjob!mimsy!cvl!elsie!nih-csl!keith From: keith@nih-csl.UUCP (keith gorlen) Newsgroups: comp.lang.c++ Subject: Re: C++ compiler problems Message-ID: <276@nih-csl.UUCP> Date: Mon, 28-Sep-87 23:00:39 EDT Article-I.D.: nih-csl.276 Posted: Mon Sep 28 23:00:39 1987 Date-Received: Wed, 30-Sep-87 04:59:03 EDT References: <31900003@webb> Organization: NIH-CSL, Bethesda, MD Lines: 42 Summary: Try substituting DEFCLASS.h for body of DEFINE_CLASS in Object.h In article <31900003@webb>, webb@webb.applicon.UUCP writes: > > We are running C++ 1.2.1. I am trying to compile OOPSLIB (a library of > Smalltalk objects for C++, distributed by Keith E. Gorlen of The National > Institutes of Health). I first have problems with the compiler complaining > that it cannot tell an int from an unsigned int with the following code: > > overload MAX; > ... > inline unsigned int MAX(unsigned int a, unsigned int b) { return a >= b ? a : b; } Can't duplicate this one. The error message sounds suspiciously like it is coming from a pre-1.2 version of C++. You don't mention what machine your using. A work-around is to delete all the overloaded inlines for ABS, MAX, MIN, etc. and substitute #defines like: #define MAX(a,b) ( (a) >= (b) ? (a) : (b) ) > When I comment out the last line that problem goes away, the compilation > proceeds further, and I get the following error: > > "Arraychar.c", line 78: error: name _reader of type type name cannot be overloaded > "Arraychar.c", line 78: error: bad base type: void Arraychar The file Object.h says the following: The DEFINE_CLASS preprocessor macro composes names by concatenating the "classname" argument with other character strings. This is done by separating the two with \-newline. If this doesn't work on your C preprocessor, try using an empty comment as a separator. If you use this technique, you may have to modify the CC script so that it doesn't use the -C option with the C preprocessor. I think this is what is going wrong in your case. The file DEFCLASS.h contains a version of the DEFINE_CLASS macro that uses empty comments. Edit Object.h to substitute this version of DEFINE_CLASS. [Note -- I think this problem gets fixed in ANSI C.]-- Keith Gorlen phone: (301) 496-5363 Building 12A, Room 2017 uucp: uunet!mimsy!elsie!nih-csl!keith National Institutes of Health Bethesda, MD 20892