SUMMARY: Compiling problems w/ gcc

Sean Ward (sdward@uswest.com)
Wed, 28 Jan 1998 14:58:00 -0700

Hi all. I'll include my full original posting at the end, but basically
the problem was that I was getting syntax and no such file errors when
reading in include files in order to compile programs.

I inherited this machine only a few weeks ago, so I don't know exactly
what happened, but it looks like bind-4.9.x was either partially
installed or not de-installed properly. Afterwards I came along and
installed gcc. During a regular install, bind changes several include
files, and the fixincludes process of installing gcc doesn't "fix" all
of these files.

Running "pkgchk SUNWhea" uncovered one "incorrect" include file, which
also happens to be one of the files bind replaces. Once I copy that file
from the OS CD I should be good to go again.

In the interim, I received the two "missing" include files, which are
part of the bind distribution. I copied them into /usr/local/include,
modified the -I lines in Makefile(s), and I was on my way. IMHO, this is
a bit kludgy though, especially when I can put the original file back on
the system to fix the problem.

Thanks to the following for their prompt replies:
"Karl E. Vogel" <vogelke@c17mis.region2.wpafb.af.mil>
Casper Dik <casper@holland.Sun.COM>
Aaron Lafferty <lafferty@oar.net>

Original posting below:
> Hi all. My system is a SS5 running 2.4 with the recommended patches
> installed.
>
> I'm having some really strange problems compiling various packages
> with gcc 2.7.2. I've checked various FAQs and the archived summaries,
> but didn't find anything specific to this.
>
> In this example, I'm trying to compile tcl8.0:
>
> sdward@nitro 145: make
> gcc -c -O -I./../generic -I. -DHAVE_GETCWD=1 -DNO_GETWD=1 -DNO_WAIT3=1
> -DHAVE_UNISTD_H=1 -DUSE_TERMIOS=1 -DHAVE_SYS_TIME_H=1
> -DTIME_WITH_SYS_TIME=1 -DHAVE_TZNAME=1 -DHAVE_TIMEZONE_VAR=1
> -DHAVE_ST_BLKSIZE=1 -Dstrtod=fixstrtod -DSTDC_HEADERS=1
> -DNO_UNION_WAIT=1 -DNEED_MATHERR=1 -Dvfork=fork -DGETTOD_NOT_DECLARED=1
> -DHAVE_SIGNED_CHAR=1 -DHAVE_SYS_IOCTL_H=1 -DHAVE_SYS_FILIO_H=1
> -DTCL_SHLIB_EXT=\".so\" ./../generic/regexp.c
> In file included from ../generic/../unix/tclUnixPort.h:98,
> from ../generic/tclPort.h:25,
> from ./../generic/regexp.c:48:
> /usr/include/arpa/inet.h:68: sys/bitypes.h: No such file or directory
> /usr/include/arpa/inet.h:72: sys/cdefs.h: No such file or directory
> *** Error code 1
> make: Fatal error: Command failed for target `regexp.o'
>
> So I figure, "OK, I'll just comment out the references to the
> non-existant include files." I then start getting syntax errors on the
> same include file:
>
> sdward@nitro 146: make
> gcc -c -O -I./../generic -I. -DHAVE_GETCWD=1 -DNO_GETWD=1 -DNO_WAIT3=1
> -DHAVE_UNISTD_H=1 -DUSE_TERMIOS=1 -DHAVE_SYS_TIME_H=1
> -DTIME_WITH_SYS_TIME=1 -DHAVE_TZNAME=1 -DHAVE_TIMEZONE_VAR=1
> -DHAVE_ST_BLKSIZE=1 -Dstrtod=fixstrtod -DSTDC_HEADERS=1
> -DNO_UNION_WAIT=1 -DNEED_MATHERR=1 -Dvfork=fork -DGETTOD_NOT_DECLARED=1
> -DHAVE_SIGNED_CHAR=1 -DHAVE_SYS_IOCTL_H=1 -DHAVE_SYS_FILIO_H=1
> -DTCL_SHLIB_EXT=\".so\" ./../generic/regexp.c
> In file included from ../generic/../unix/tclUnixPort.h:98,
> from ../generic/tclPort.h:25,
> from ./../generic/regexp.c:48:
> /usr/include/arpa/inet.h:75: syntax error before `unsigned'
> /usr/include/arpa/inet.h:75: parse error before `__P'
> /usr/include/arpa/inet.h:76: parse error before `__P'
> /usr/include/arpa/inet.h:77: parse error before `__P'
> /usr/include/arpa/inet.h:78: parse error before `__P'
> /usr/include/arpa/inet.h:79: parse error before `__P'
> /usr/include/arpa/inet.h:80: parse error before `__P'
> /usr/include/arpa/inet.h:81: parse error before `__P'
> In file included from ../generic/../unix/tclUnixPort.h:99,
> from ../generic/tclPort.h:25,
> from ./../generic/regexp.c:48:
> /usr/include/netdb.h:105: syntax error before `struct'
> *** Error code 1
> make: Fatal error: Command failed for target `regexp.o'
>
> When I ran configure for tcl, I passed it the '--enable-gcc' flag, so I
> don't think this is a tcl config problem.
>
> I'm guessing that this is a problem with gcc, but I don't have access to
> a different compiler to find out for sure. Gcc was built and installed
> after all the patches were installed, and with no errors.
>
> I'm also getting similar error messages with the netdb.h that gcc
> "fixed" (the one in
> /usr/local/lib/gcc-lib/sparc-sun-solaris/2.7.2/include).
>
> Any ideas?

-- 
Sean Ward                       Phone: 303-685-2106
US West TSS Unix Support        Fax: 303-624-3284
sdward@uswest.com

"Bother", said Pooh. "Eeyore, ready photon torpedoes and lock phasers on the Heffalump. Piglet, meet me in transporter room three."