Topic: Problem installing AT&T C++ on Sun
Author: hadrian@carson.u.washington.edu (Scott Kamara)
Date: 17 Jan 93 21:19:25 GMT Raw View
The process of doing the 'make CC=./CC patch' when installing
AT&T C++ 2.1 on a Sun breaks when trying to compile alloc.c.
The error messages are below.
Apparently there is a conflict bwtween the definition of size_t
that C++ wants to use and that Sun uses for their C compiler.
The SunOS is 4.1.2. The C compiler is Sun C (SC1.0).
The header /usr/include/sys/stdtypes.h does indeed use
"typedef int size_t".
Any suggestions??
The four error messages are:
/home/attc++/CC -O -DBSD -c alloc.c
CC alloc.c:
1) "/usr/include/sys/stdtypes.h", line 27: error:
size_t redefined: previous: unsigned int now: int
2) "/usr/include/sys/stdtypes.h", line 27: error:
size_t declared as unsigned int and int
3) "/home/attc++/incl/new.h", line 21: error:
operator new() requires a first argument of type size_t
4) "alloc.c", line 55: error:
operator new() requires a first argument of type size_t
4 errors
*** Error code 1
---------------------------------------------------------
---------------------------------------------------------
Scott Kamara
Applied Physics Lab, University of Washington
scott@apl.washington.edu
(206) 543-1300
Author: gordon@cs.uow.edu.au (Gordon Cheng)
Date: Wed, 20 Jan 1993 00:24:54 GMT Raw View
hadrian@carson.u.washington.edu (Scott Kamara) writes:
The best way to fix this is just change /usr/include/sys/stdtypes.h
from int to unsigned int.
Or, put #if __CPLUSPLUS__
... unsigned int ...
#else
... int ...
#endif
then when compiling it use the -D__CPLUSPLUS__ option.
Gordon
>The process of doing the 'make CC=./CC patch' when installing
>AT&T C++ 2.1 on a Sun breaks when trying to compile alloc.c.
>The error messages are below.
>Apparently there is a conflict bwtween the definition of size_t
>that C++ wants to use and that Sun uses for their C compiler.
>The SunOS is 4.1.2. The C compiler is Sun C (SC1.0).
>The header /usr/include/sys/stdtypes.h does indeed use
>"typedef int size_t".
>Any suggestions??
>The four error messages are:
>/home/attc++/CC -O -DBSD -c alloc.c
>CC alloc.c:
>1) "/usr/include/sys/stdtypes.h", line 27: error:
> size_t redefined: previous: unsigned int now: int
>2) "/usr/include/sys/stdtypes.h", line 27: error:
> size_t declared as unsigned int and int
>3) "/home/attc++/incl/new.h", line 21: error:
> operator new() requires a first argument of type size_t
>4) "alloc.c", line 55: error:
> operator new() requires a first argument of type size_t
>4 errors
>*** Error code 1
>---------------------------------------------------------
>---------------------------------------------------------
>Scott Kamara
>Applied Physics Lab, University of Washington
>scott@apl.washington.edu
>(206) 543-1300
--
Gordon Cheng Email: gordon@cs.uow.edu.au
Computer System Officer PSTNet: (042) 21 3821 (direct)
Department of Computer Science (042) 21 3859 (dept)
University of Wollongong Fax: (042) 21 3262